Skip to content

Commit

Permalink
Fix crash in studio
Browse files Browse the repository at this point in the history
  • Loading branch information
Corentin Jabot authored and cor3ntin committed Oct 10, 2018
1 parent ba7638d commit c7d7a9b
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions clients/studio/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2857,7 +2857,8 @@ namespace Aseba
void MainWindow::addErrorEvent(unsigned node, unsigned line, const QString& message)
{
NodeTab* tab = getTabFromId(node);
Q_ASSERT(tab);
if(!tab)
return;

if (tab->setEditorProperty("executionError", QVariant(), line, true))
{
Expand All @@ -2880,7 +2881,8 @@ namespace Aseba
void MainWindow::executionPosChanged(unsigned node, unsigned line)
{
NodeTab* tab = getTabFromId(node);
Q_ASSERT(tab);
if(!tab)
return;

tab->executionPosChanged(line);
}
Expand All @@ -2889,7 +2891,8 @@ namespace Aseba
void MainWindow::executionModeChanged(unsigned node, Target::ExecutionMode mode)
{
NodeTab* tab = getTabFromId(node);
Q_ASSERT(tab);
if(!tab)
return;

tab->executionModeChanged(mode);
}
Expand All @@ -2898,7 +2901,8 @@ namespace Aseba
void MainWindow::variablesMemoryEstimatedDirty(unsigned node)
{
NodeTab* tab = getTabFromId(node);
Q_ASSERT(tab);
if(!tab)
return;

tab->refreshMemoryClicked();
}
Expand All @@ -2907,7 +2911,8 @@ namespace Aseba
void MainWindow::variablesMemoryChanged(unsigned node, unsigned start, const VariablesDataVector &variables)
{
NodeTab* tab = getTabFromId(node);
Q_ASSERT(tab);
if(!tab)
return;

tab->vmMemoryModel->setVariablesData(start, variables);
}
Expand All @@ -2916,7 +2921,8 @@ namespace Aseba
void MainWindow::breakpointSetResult(unsigned node, unsigned line, bool success)
{
NodeTab* tab = getTabFromId(node);
Q_ASSERT(tab);
if(!tab)
return;

tab->breakpointSetResult(line, success);
}
Expand Down

0 comments on commit c7d7a9b

Please sign in to comment.