Skip to content

Commit c49673a

Browse files
Merge pull request #30 from ParsePlatform/richardross.push.crash
Fix NullReferenceException when push notification handler hasn't been registered.
2 parents 356d29b + 1def7dc commit c49673a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Parse/ParsePush.WinRT.cs

100644100755
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ static ParsePush() {
1818
t.Result.PushNotificationReceived += (sender, args) => {
1919
PushNotificationReceived(ParseInstallation.CurrentInstallation, args);
2020

21-
var payload = PushJson(args);
22-
parsePushNotificationReceived.Invoke(ParseInstallation.CurrentInstallation, new ParsePushNotificationEventArgs(payload));
21+
var payload = PushJson(args);
22+
var handler = parsePushNotificationReceived;
23+
if (handler != null) {
24+
handler.Invoke(ParseInstallation.CurrentInstallation, new ParsePushNotificationEventArgs(payload));
25+
}
2326
}
2427
);
2528
}

0 commit comments

Comments
 (0)