Skip to content

Commit 54ef679

Browse files
committed
nullref error fix when no active scene was found
1 parent 8bf7681 commit 54ef679

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Samples/Scripts/ScriptableObjectSample.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ public class ScriptableObjectSample : BaseNotesSO
1313
#if UNITY_EDITOR
1414
private void OnDisable()
1515
{
16-
if (SceneManager.GetActiveScene().name.Equals(sceneToCheck))
16+
Scene activeScene = SceneManager.GetActiveScene();
17+
if (activeScene.name != null && activeScene.name.Equals(sceneToCheck))
1718
{
1819
Debug.Log(this.name + " SO Disable: ");
1920
Debug.Log("Application.isPlaying: " + Application.isPlaying);

0 commit comments

Comments
 (0)