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
|
class AssetHierarchy
|
||||||
{
|
{
|
||||||
FileSystemWatcher fsw ~ {
|
FileSystemWatcher fsw ~ {
|
||||||
_.StopRaisingEvents();
|
_?.StopRaisingEvents();
|
||||||
delete _;
|
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()
|
private void NavigateUp()
|
||||||
{
|
{
|
||||||
@@ -1528,11 +1528,14 @@ namespace GlitchyEditor.EditWindows
|
|||||||
|
|
||||||
TreeNode<AssetNode> walker = _currentDirectoryNode;
|
TreeNode<AssetNode> walker = _currentDirectoryNode;
|
||||||
|
|
||||||
repeat
|
if (walker != null)
|
||||||
{
|
{
|
||||||
path.AddFront(walker);
|
repeat
|
||||||
walker = walker.Parent;
|
{
|
||||||
} while (walker != _manager.AssetHierarchy.RootNode);
|
path.AddFront(walker);
|
||||||
|
walker = walker.Parent;
|
||||||
|
} while (walker != _manager.AssetHierarchy.RootNode);
|
||||||
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
|
|
||||||
@@ -1601,7 +1604,7 @@ namespace GlitchyEditor.EditWindows
|
|||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_currentDirectoryNode.Children.Any((c) => c->IsDirectory))
|
if (_currentDirectoryNode?.Children.Any((c) => c->IsDirectory) ?? false)
|
||||||
{
|
{
|
||||||
ImGui.Button("...");
|
ImGui.Button("...");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user