Microsoft Graph API calendarView null pointer when meeting has no title

Joseph Nguyen 0 Reputation points
2026-12-03T18:40:07.0333333+00:00

Calling the https://graph.microsoft.com/v1.0/me/calendarView/ endpoint on a user that has a calendar event with no title makes the entire API call fail with a 500 Internal Server Error. We are filtering on the subject of each meeting using contains.

Select query:

$select=id,subject,body,webLink,start,end,location,isCancelled,responseStatus,organizer&$filter=contains(subject,'client')&$top=50

Steps to reproduce:

  1. Open Outlook and go to your Calendar
  2. Create a new meeting by clicking New Event
  3. Leave the meeting title field blank
  4. Save the event
  5. Try to call the /v1.0/me/calendarView API with a startDateTime and endDateTime that covers the newly created meeting event
  6. Get 500 Error because of NPE

Response body:

{"error":{"code":"ErrorInternalServerError","message":"An internal server error occurred. The operation failed.","innererror":{"message":"Object reference not set to an instance of an object.","type":"System.NullReferenceException"}}}
Microsoft Security | Microsoft Graph
0 comments No comments

Answer accepted by question author

AI answer

2026-12-03T18:42:26.5766667+00:00

Remove the server-side subject filter from calendarView, retrieve the date-range results, and apply null-safe subject matching in your application; this is the confirmed workaround for the blank-subject HTTP 500 defect.^1^

Safe request

Keep $select and $top, but omit $filter:

GET https://graph.microsoft.com/v1.0/me/calendarView?startDateTime=2024-06-24T14:00:00Z&endDateTime=2024-06-24T15:00:00Z&$select=id,subject,body,webLink,start,end,location,isCancelled,responseStatus,organizer&$top=50

Then filter locally while treating a null subject as an empty string:

const string searchText = "client";

var matches = events
    .Where(e => (e.Subject ?? string.Empty)
        .Contains(searchText, StringComparison.OrdinalIgnoreCase))
    .ToList();

This provides case-insensitive matching locally without invoking the defective server-side subject-filter path.

Process every page before applying or completing the filter. calendarView returns @odata.nextLink when more results exist, and $top supports values from 1 through 1000.^2^

Optional null-guard workaround to test

The issue discussion reports that this form works with startswith:

$filter=subject ne null and startswith(subject,'client')

You can test the analogous expression:

$filter=subject ne null and contains(subject,'client')

However, the reported workaround was verified with startswith, not contains, and the documentation does not guarantee short-circuit evaluation of and. Therefore, do not rely on this variation until it has been tested against affected mailboxes. Microsoft Graph supports contains, but filter support can vary by resource and property.^3^

Permanent resolution and escalation

The matching issue reproduces the failure in both Graph Explorer and the SDK and was closed because no SDK change could fix it; the underlying behavior is in the Graph API backend.^1^ Only Microsoft can permanently correct that defect.

For production impact:

  1. Open or reopen a Microsoft support request.
  2. Include the exact request with sensitive values removed, UTC timestamp, HTTP status and response body, Graph request/correlation IDs from the response headers, and affected tenant information through the secure support channel.
  3. Mention that removing $filter succeeds and that a null-subject event within the requested interval reproduces the failure.
  4. Submit product feedback through Microsoft Graph feedback.

References

  1. Using startswith filter on CalendarView query throws 500 error if any events have no subject · Issue #2559 · microsoftgraph/msgraph-sdk-dotnet
  2. List calendarView
  3. Use the $filter query parameter
AI-generated content may be incorrect. Read our transparency notes for more information.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.