summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/listeners/baselistener.hpp3
-rw-r--r--src/listeners/guitableactionlistener.cpp2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/listeners/baselistener.hpp b/src/listeners/baselistener.hpp
index 1ba5c3d33..a1fa643ca 100644
--- a/src/listeners/baselistener.hpp
+++ b/src/listeners/baselistener.hpp
@@ -38,7 +38,8 @@
\
void name::addListener(name *const listener) \
{ \
- mListeners.push_back(listener); \
+ if (listener) \
+ mListeners.push_back(listener); \
} \
\
void name::removeListener(const name *const listener) \
diff --git a/src/listeners/guitableactionlistener.cpp b/src/listeners/guitableactionlistener.cpp
index e71abb9b1..d0a2b7a18 100644
--- a/src/listeners/guitableactionlistener.cpp
+++ b/src/listeners/guitableactionlistener.cpp
@@ -36,7 +36,7 @@ GuiTableActionListener::GuiTableActionListener(GuiTable *const restrict table,
mColumn(column),
mWidget(widget)
{
- if (widget)
+ if (widget && table)
{
widget->addActionListener(this);
widget->setParent(table);