Skip to content

System.NullReferenceException When Oncall Schedule Doesn't Have User #405

@jzhang-sre

Description

@jzhang-sre

@NickCraver we have an on call schedule that only has people during the weekend, it's blank during the weekday so we get this object reference error:

System.NullReferenceException: Object reference not set to an instance of an object.
   at AspNetCore.Views_PagerDuty_PagerDuty_OnCallRow.ExecuteAsync() in /_/src/OpServer.Web/Views/PagerDuty/PagerDuty.OnCallRow.cshtml:line 3

My C# is bad but I think an if statement wrapping the following line checking if the fields in the object are not null would fix this.

@Html.Partial("PagerDuty.OnCallRow", a)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions