From f2db83f3fd77b42392c3b91f038ae61a1752ee2f Mon Sep 17 00:00:00 2001 From: akir Date: Thu, 2 Sep 2004 09:52:26 +0000 Subject: fix to avoid crash when in remember-submenu and closing the application -> current clientwindow would be 0x0 -> crash --- src/Remember.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Remember.cc b/src/Remember.cc index 47528af..05690d4 100644 --- a/src/Remember.cc +++ b/src/Remember.cc @@ -21,7 +21,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Remember.cc,v 1.40 2004/09/02 08:58:06 akir Exp $ +// $Id: Remember.cc,v 1.41 2004/09/02 09:52:26 akir Exp $ #include "Remember.hh" #include "ClientPattern.hh" @@ -79,14 +79,19 @@ public: m_win(fbwin), m_attrib(attrib) {} bool isSelected() const { - return m_remember.isRemembered(m_win.winClient(), m_attrib); + if (m_win.numClients()) // ensure it HAS clients + return m_remember.isRemembered(m_win.winClient(), m_attrib); + else + return false; } bool isEnabled() const { if (m_attrib != Remember::REM_JUMPWORKSPACE) return true; - else + else if (m_win.numClients()) return (m_remember.isRemembered(m_win.winClient(), Remember::REM_WORKSPACE)); + else + return false; } void click(int button, int time) { -- cgit v0.11.2