Skip to content

fix: null refs preventing users from quitting #563

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Assets/BossRoom/Scripts/Shared/ApplicationController.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Collections;
using BossRoom.Scripts.Shared.Net.UnityServices.Auth;
using Unity.Multiplayer.Samples.BossRoom.Client;
Expand All @@ -6,7 +7,6 @@
using Unity.Multiplayer.Samples.BossRoom.Shared.Net.UnityServices.Infrastructure;
using Unity.Multiplayer.Samples.BossRoom.Shared.Net.UnityServices.Lobbies;
using Unity.Multiplayer.Samples.Utilities;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.SceneManagement;

Expand Down Expand Up @@ -88,7 +88,15 @@ private void OnDestroy()
/// </summary>
private IEnumerator LeaveBeforeQuit()
{
m_LobbyServiceFacade.ForceLeaveLobbyAttempt();
// We want to quit anyways, so if anything happens while trying to leave the Lobby, log the exception then carry on
try
{
m_LobbyServiceFacade.ForceLeaveLobbyAttempt();
}
catch (Exception e)
{
Debug.LogError(e.Message);
}
yield return null;
Application.Quit();
}
Expand Down