Skip to content

Commit

Permalink
* Fixed: setting empty string to SceneReference path caused exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
NibbleByte committed Feb 1, 2022
1 parent d4bf3e9 commit 308173d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions SceneReference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<SceneAsset>(m_ScenePath);
if (m_SceneAsset == null) {
Debug.LogError($"Setting {nameof(SceneReference)} to {value}, but no scene could be located there.");
Expand Down

0 comments on commit 308173d

Please sign in to comment.