Skip to content

Commit

Permalink
fix: fix crash when main camera is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
mwfarb committed Nov 13, 2024
1 parent 03f9960 commit 3aa7cb5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Runtime/ArenaClientScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public IEnumerator ConnectArena()
bool foundFirstCam = false;
foreach (ArenaCamera cam in camlist)
{
if ((cam.name == Camera.main.name || camlist.Length == 1) && !foundFirstCam)
if ((Camera.main != null && cam.name == Camera.main.name || camlist.Length == 1) && !foundFirstCam)
{
// publish main/selected camera
cam.userid = userid;
Expand Down

0 comments on commit 3aa7cb5

Please sign in to comment.