From de774a5c0e749a0667ebc8196e6872aa5da92745 Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Thu, 3 Mar 2016 18:11:44 +0100 Subject: [PATCH] Fix crashing when hitting tab in texture edit mode --- src/Application/TextureMappingState.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Application/TextureMappingState.cpp b/src/Application/TextureMappingState.cpp index f565dac..fb61fea 100644 --- a/src/Application/TextureMappingState.cpp +++ b/src/Application/TextureMappingState.cpp @@ -35,10 +35,12 @@ void TextureMappingState::onKeyPressed(Application * app, ofKeyEventArgs & args) break; case OF_KEY_TAB: - app->getCmdManager()->exec( - new SetNextSourceCmd( - app->getSurfaceManager()->getSelectedSurface(), - app->getGui()->getSourcesEditor())); + if(app->getSurfaceManager()->getSelectedSurface() != 0){ + app->getCmdManager()->exec( + new SetNextSourceCmd( + app->getSurfaceManager()->getSelectedSurface(), + app->getGui()->getSourcesEditor())); + } break; }