summaryrefslogtreecommitdiff
path: root/src/gui/windows/textcommandeditor.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-21 02:12:14 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-21 02:53:45 +0300
commitff10b54405fe8980a022e98cd79d912c1f0ac353 (patch)
tree679a8096d1e30858760196c2a2ef95ddd6bcd58c /src/gui/windows/textcommandeditor.cpp
parent6c01b391c288622d8e360d823c9c1e35a874fa58 (diff)
downloadplus-ff10b54405fe8980a022e98cd79d912c1f0ac353.tar.gz
plus-ff10b54405fe8980a022e98cd79d912c1f0ac353.tar.bz2
plus-ff10b54405fe8980a022e98cd79d912c1f0ac353.tar.xz
plus-ff10b54405fe8980a022e98cd79d912c1f0ac353.zip
Add missing checks.
Diffstat (limited to 'src/gui/windows/textcommandeditor.cpp')
-rw-r--r--src/gui/windows/textcommandeditor.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/windows/textcommandeditor.cpp b/src/gui/windows/textcommandeditor.cpp
index c2a5d66c9..5c59cd389 100644
--- a/src/gui/windows/textcommandeditor.cpp
+++ b/src/gui/windows/textcommandeditor.cpp
@@ -133,7 +133,8 @@ TextCommandEditor::TextCommandEditor(TextCommand *const command) :
mIconDropDown->setActionEventId("icon");
mIconDropDown->addActionListener(this);
- mIconDropDown->setSelectedString(mCommand->getIcon());
+ if (mCommand)
+ mIconDropDown->setSelectedString(mCommand->getIcon());
mSaveButton->adjustSize();
mCancelButton->adjustSize();
@@ -291,6 +292,8 @@ void TextCommandEditor::scheduleDelete()
void TextCommandEditor::save()
{
+ if (!mCommand)
+ return;
#ifdef TMWA_SUPPORT
if (mIsMagicCommand)
mCommand->setCommandType(TextCommandType::Magic);
@@ -318,6 +321,8 @@ void TextCommandEditor::save()
void TextCommandEditor::deleteCommand()
{
+ if (!mCommand)
+ return;
mCommand->setSymbol("");
mCommand->setCommand("");
mCommand->setComment("");