From 308173dab1b5899ce34e834fdd07e13e550b69af Mon Sep 17 00:00:00 2001 From: NibbleByte Date: Tue, 1 Feb 2022 09:52:01 +0200 Subject: [PATCH] * Fixed: setting empty string to SceneReference path caused exception. --- SceneReference.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/SceneReference.cs b/SceneReference.cs index 615e1a6..a05abe5 100644 --- a/SceneReference.cs +++ b/SceneReference.cs @@ -61,6 +61,11 @@ public string ScenePath m_ScenePath = value; #if UNITY_EDITOR + if (string.IsNullOrEmpty(m_ScenePath)) { + m_SceneAsset = null; + return; + } + m_SceneAsset = AssetDatabase.LoadAssetAtPath(m_ScenePath); if (m_SceneAsset == null) { Debug.LogError($"Setting {nameof(SceneReference)} to {value}, but no scene could be located there.");