From f570ce448fcd3463fc9cfc50c83230dc68b9bafd Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Wed, 24 Aug 2016 21:19:22 +0300 Subject: [PATCH] Fix bug in ProjectionMappingState::onGuiEvent Mouse releassed event caused crash --- src/Application/ProjectionMappingState.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Application/ProjectionMappingState.cpp b/src/Application/ProjectionMappingState.cpp index 4024ccc..7ca7b29 100644 --- a/src/Application/ProjectionMappingState.cpp +++ b/src/Application/ProjectionMappingState.cpp @@ -348,6 +348,10 @@ void ProjectionMappingState::onGuiEvent(Application * app, GuiEvent & e){ _surfaceScaleBeforeTransform = app->getSurfaceManager()->getSelectedSurface()->getScale(); }else if(e.args.type == e.args.Released){ + if(app->getSurfaceManager()->getSelectedSurface() == 0){ + return; + } + if(_surfaceScaleBeforeTransform != app->getSurfaceManager()->getSelectedSurface()->getScale()){