Skip to content

Commit

Permalink
Fixed NRE
Browse files Browse the repository at this point in the history
Fixed null reference exception and subsequent crash that happens for some people.
  • Loading branch information
Jdbye committed Nov 19, 2021
1 parent fb70e60 commit fdd562c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions AdvancedInvites/AdvancedInviteSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ private static IntPtr AddNotificationPatch(IntPtr instancePtr, IntPtr notificati
catch { }
#endif

if (!HandledNotifications.Contains(notification.id))
if (notification.id != null && !HandledNotifications.Contains(notification.id))
{
HandledNotifications.Add(notification.id);
HandleNotification(ref notification);
Expand All @@ -227,7 +227,7 @@ private static void HandleNotification(ref Notification notification)
if (Utilities.CurrentRoom() == null
|| Utilities.CurrentWorldInstance() == null) return;

switch (notification.notificationType.ToLowerInvariant())
if (notification.notificationType != null) switch (notification.notificationType.ToLowerInvariant())
{
case "invite":
#if DEBUG
Expand Down Expand Up @@ -348,7 +348,7 @@ private static void AcceptNotificationPatch(IntPtr thisPtr, IntPtr notificationP
catch { }
#endif

if (notification.notificationType.Equals("invite", StringComparison.OrdinalIgnoreCase))
if (notification.notificationType != null && notification.notificationType.Equals("invite", StringComparison.OrdinalIgnoreCase))
{
InviteHandler.HandleInvite(notification);
return;
Expand Down
3 changes: 2 additions & 1 deletion AdvancedInvites/BuildInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public static class BuildInfo
// 1.6.7 Updated for build 1128, fixed sound loading issue, delete works again
// 1.6.8 Updated for VRC build 1149
// 1.6.9 Updated for VRC build 1151
public const string Version = "1.6.9";
// 1.6.10 Hopefully fixed NRE
public const string Version = "1.6.10";

}

Expand Down

0 comments on commit fdd562c

Please sign in to comment.