fix memory leak and possible nullptr read

Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com>
This commit is contained in:
chcurran
2021-08-17 16:40:48 -07:00
parent de9e991ccc
commit 1ad182105b
2 changed files with 19 additions and 18 deletions
@@ -734,7 +734,7 @@ namespace ScriptCanvasEditor
{
ui->statusTableView->clearSelection();
if (auto model = GetActiveData().second->GetModel())
if (auto model = GetActiveData().second ? GetActiveData().second->GetModel() : nullptr)
{
model->Clear();
model->RunValidation(m_activeGraphIds.scriptCanvasId);