summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-24 15:04:49 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-25 20:18:59 +0300
commit2bde1b0193dbef84c9d95c9826aecb910d901196 (patch)
tree7f4e3cd41df3a41459f9bde2b5a80c73d755fe72 /src
parent9d521a19be347703bfdbb7802d0397a59c3edd7a (diff)
downloadplus-2bde1b0193dbef84c9d95c9826aecb910d901196.tar.gz
plus-2bde1b0193dbef84c9d95c9826aecb910d901196.tar.bz2
plus-2bde1b0193dbef84c9d95c9826aecb910d901196.tar.xz
plus-2bde1b0193dbef84c9d95c9826aecb910d901196.zip
Add missing checks into popups.
Diffstat (limited to 'src')
-rw-r--r--src/gui/popups/itempopup.h3
-rw-r--r--src/gui/popups/popupmenu.cpp3
-rw-r--r--src/gui/popups/popupmenu.h5
3 files changed, 8 insertions, 3 deletions
diff --git a/src/gui/popups/itempopup.h b/src/gui/popups/itempopup.h
index c8ff7457a..32ace3af3 100644
--- a/src/gui/popups/itempopup.h
+++ b/src/gui/popups/itempopup.h
@@ -75,7 +75,8 @@ class ItemPopup final : public Popup
int mLastId;
unsigned char mLastColor;
- void setLabelColor(Label *label, const ItemType::Type type) const;
+ void setLabelColor(Label *label,
+ const ItemType::Type type) const A_NONNULL(2);
};
extern ItemPopup *itemPopup;
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index f136e5bd5..10ae03365 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -968,6 +968,9 @@ void PopupMenu::showWindowPopup(Window *const window)
void PopupMenu::addWindowMenu(Window *const window)
{
+ if (!window)
+ return;
+
if (window->getCloseButton())
{
// TRANSLATORS: popup menu item
diff --git a/src/gui/popups/popupmenu.h b/src/gui/popups/popupmenu.h
index d963591bc..ac6798ce1 100644
--- a/src/gui/popups/popupmenu.h
+++ b/src/gui/popups/popupmenu.h
@@ -168,7 +168,7 @@ class PopupMenu final : public Popup, public LinkHandler
void addFollow();
- void addBuySell(const Being *const being);
+ void addBuySell(const Being *const being) A_NONNULL(2);
void addParty(const std::string &nick);
@@ -182,7 +182,8 @@ class PopupMenu final : public Popup, public LinkHandler
void addProtection();
- void addUseDrop(const Item *const item, const bool isProtected);
+ void addUseDrop(const Item *const item,
+ const bool isProtected) A_NONNULL(2);
void addGmCommands();