From 49d2cd14f01b1497a6879336232057d594a53fa2 Mon Sep 17 00:00:00 2001 From: David Capello Date: Tue, 5 Sep 2017 15:26:21 -0300 Subject: [PATCH] Don't add a reference layer if the user cancels the dialog --- src/app/commands/cmd_new_layer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/commands/cmd_new_layer.cpp b/src/app/commands/cmd_new_layer.cpp index 06ec3122c..100969b04 100644 --- a/src/app/commands/cmd_new_layer.cpp +++ b/src/app/commands/cmd_new_layer.cpp @@ -143,6 +143,10 @@ void NewLayerCommand::onExecute(Context* context) static_cast(context) ->setActiveDocument(oldActiveDocument); } + // If the user didn't selected a new document, it means that the + // file selector dialog was canceled. + else + return; } // If params specify to ask the user about the name...