Do not crash while importing/adding bookmarks.

BUG: 309370
REVIEW: 112042
FIXED-IN: 4.11.1
This commit is contained in:
Dawit Alemayehu 2013-08-12 19:31:13 -04:00
parent 6b375d2e26
commit d1963e23dd

View file

@ -185,11 +185,15 @@ void KBookmarkBar::fillBookmarkBar(const KBookmarkGroup & parent)
if (!bm.isGroup())
{
if ( bm.isSeparator() )
m_toolBar->addSeparator();
if (m_toolBar) {
m_toolBar->addSeparator();
}
else
{
KAction *action = new KBookmarkAction( bm, m_pOwner, 0 );
m_toolBar->addAction(action);
if (m_toolBar) {
m_toolBar->addAction(action);
}
d->m_actions.append( action );
}
}
@ -197,7 +201,9 @@ void KBookmarkBar::fillBookmarkBar(const KBookmarkGroup & parent)
{
KBookmarkActionMenu *action = new KBookmarkActionMenu(bm, 0);
action->setDelayed( false );
m_toolBar->addAction(action);
if (m_toolBar) {
m_toolBar->addAction(action);
}
d->m_actions.append( action );
KBookmarkMenu *menu = new KonqBookmarkMenu(m_pManager, m_pOwner, action, bm.address());
m_lstSubMenus.append( menu );