From c551f8981eba838d07245d1597e9deaa00427cee Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 23 Jun 2015 18:22:00 +0300 Subject: Add missing checks into listeners. --- src/listeners/baselistener.hpp | 3 ++- src/listeners/guitableactionlistener.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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); -- cgit v1.2.3-70-g09d2