mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
At least don't crash when no project is opened
This commit is contained in:
@@ -13,7 +13,7 @@ namespace GlitchyEditor.Assets;
|
||||
class AssetHierarchy
|
||||
{
|
||||
FileSystemWatcher fsw ~ {
|
||||
_.StopRaisingEvents();
|
||||
_?.StopRaisingEvents();
|
||||
delete _;
|
||||
};
|
||||
|
||||
|
||||
@@ -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<AssetNode> 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("...");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user