From eee788f45a7b89c8484b23b8520c9adde78832f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sun, 13 Sep 2009 13:46:58 +0000 Subject: [PATCH] Don't crash when focus chain is empty. svn path=/trunk/KDE/kdebase/workspace/; revision=1022903 --- tabbox.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tabbox.cpp b/tabbox.cpp index b9867f044b..62f28ee297 100644 --- a/tabbox.cpp +++ b/tabbox.cpp @@ -91,8 +91,13 @@ QString TabBoxHandlerImpl::desktopName( int desktop ) const TabBoxClient* TabBoxHandlerImpl::nextClientFocusChain( TabBoxClient* client ) const { - Client* current = (static_cast< TabBoxClientImpl* >( client ))->client(); - return Workspace::self()->nextClientFocusChain( current )->tabBoxClient(); + if( TabBoxClientImpl* c = static_cast< TabBoxClientImpl* >( client ) ) + { + Client* next = Workspace::self()->nextClientFocusChain( c->client() ); + if( next ) + return next->tabBoxClient(); + } + return NULL; } int TabBoxHandlerImpl::nextDesktopFocusChain( int desktop ) const