Don't crash when focus chain is empty.

svn path=/trunk/KDE/kdebase/workspace/; revision=1022903
This commit is contained in:
Martin Gräßlin 2009-09-13 13:46:58 +00:00
parent c4b279eed5
commit eee788f45a

View file

@ -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