Skip to content

Commit 1def7dc

Browse files
Fix NullReferenceException when push notification handler hasn't been registered.
When a push was received without a handler, we would previously crash. This doesn't exist as an issue on other platforms, as we use other notification delivery systems there. Fixes #27.
1 parent bc9e948 commit 1def7dc

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)