Skip to content

Commit

Permalink
#6107: Fix a crash when switching maps
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Oct 2, 2022
1 parent 0544faf commit 00e53b9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions radiant/ui/layers/LayerControlDialog.cpp
Expand Up @@ -283,10 +283,7 @@ void LayerControlDialog::update()
{
_updateTreeOnIdle = false;

if (!GlobalMapModule().getRoot())
{
return;
}
if (!GlobalMapModule().getRoot()) return;

auto& layerManager = GlobalMapModule().getRoot()->getLayerManager();
auto activeLayerId = layerManager.getActiveLayer();
Expand Down Expand Up @@ -347,7 +344,9 @@ void LayerControlDialog::updateLayerUsage()
{
_rescanSelectionOnIdle = false;

// Scan the selection and get the histogram
if (!GlobalMapModule().getRoot()) return;

// Scan the selection and get the histogram
auto breakDown = scene::LayerUsageBreakdown::CreateFromSelection();

GlobalMapModule().getRoot()->getLayerManager().foreachLayer([&](int layerId, const std::string& layerName)
Expand Down

0 comments on commit 00e53b9

Please sign in to comment.