diff --git a/GlitchyEditor/src/Assets/AssetHierarchy.bf b/GlitchyEditor/src/Assets/AssetHierarchy.bf index 3b4c67d..87c543a 100644 --- a/GlitchyEditor/src/Assets/AssetHierarchy.bf +++ b/GlitchyEditor/src/Assets/AssetHierarchy.bf @@ -13,7 +13,7 @@ namespace GlitchyEditor.Assets; class AssetHierarchy { FileSystemWatcher fsw ~ { - _.StopRaisingEvents(); + _?.StopRaisingEvents(); delete _; }; diff --git a/GlitchyEditor/src/EditWindows/ContentBrowserWindow.bf b/GlitchyEditor/src/EditWindows/ContentBrowserWindow.bf index 986e78a..ab3463e 100644 --- a/GlitchyEditor/src/EditWindows/ContentBrowserWindow.bf +++ b/GlitchyEditor/src/EditWindows/ContentBrowserWindow.bf @@ -302,7 +302,7 @@ namespace GlitchyEditor.EditWindows } } - private bool CanNavigateUp => _currentDirectoryNode.Parent != _manager.AssetHierarchy.RootNode; + private bool CanNavigateUp => _currentDirectoryNode?.Parent != _manager.AssetHierarchy.RootNode; private void NavigateUp() { @@ -1528,11 +1528,14 @@ namespace GlitchyEditor.EditWindows TreeNode walker = _currentDirectoryNode; - repeat + if (walker != null) { - path.AddFront(walker); - walker = walker.Parent; - } while (walker != _manager.AssetHierarchy.RootNode); + repeat + { + path.AddFront(walker); + walker = walker.Parent; + } while (walker != _manager.AssetHierarchy.RootNode); + } ImGui.SameLine(); @@ -1601,7 +1604,7 @@ namespace GlitchyEditor.EditWindows ImGui.SameLine(); } - if (_currentDirectoryNode.Children.Any((c) => c->IsDirectory)) + if (_currentDirectoryNode?.Children.Any((c) => c->IsDirectory) ?? false) { ImGui.Button("...");