From 558943ebecb096b6a57371d8e98433d254d8a539 Mon Sep 17 00:00:00 2001 From: Gaspar Capello Date: Tue, 15 Oct 2019 15:59:10 -0300 Subject: [PATCH] Fix Set Ink Type command crash when it is executed without UI --- src/app/commands/cmd_set_ink_type.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/app/commands/cmd_set_ink_type.cpp b/src/app/commands/cmd_set_ink_type.cpp index 824cfd2ef..c0c04f12a 100644 --- a/src/app/commands/cmd_set_ink_type.cpp +++ b/src/app/commands/cmd_set_ink_type.cpp @@ -65,9 +65,8 @@ bool SetInkTypeCommand::onChecked(Context* context) void SetInkTypeCommand::onExecute(Context* context) { - App::instance() - ->contextBar() - ->setInkType(m_type); + if (App::instance()->contextBar() != nullptr) + App::instance()->contextBar()->setInkType(m_type); } std::string SetInkTypeCommand::onGetFriendlyName() const