Skip to content

NullReferenceException raised when a push notification is received #27

@andreiasandei

Description

@andreiasandei

When the client app does not register to the ParsePush.PushNotificationReceived event, when a push notification is received, the event is fired, but since no-one had registred, it is null and a NullReferenceException is thrown on this line: PushNotificationReceived(ParseInstallation.CurrentInstallation, args);

The code should read something like this:

var handler = PushNotificationReceived;
if (handler != null)
{
handler(ParseInstallation.CurrentInstallation, args);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions