From: Veaceslav Munteanu Date: Thu, 06 Aug 2015 18:50:00 +0000 Subject: fix crash with tags manager add tag with null parent BUG: 343548 X-Git-Url: http://quickgit.kde.org/?p=digikam.git&a=commitdiff&h=6eace137db05f0b5648bc34e0f690cf642c121db --- fix crash with tags manager add tag with null parent BUG: 343548 --- --- a/core/app/tags/tagsmanager/tagsmanager.cpp +++ b/core/app/tags/tagsmanager/tagsmanager.cpp @@ -258,11 +258,16 @@ void TagsManager::slotAddAction() { - TAlbum* const parent = d->tagMngrView->currentAlbum(); + TAlbum* parent = d->tagMngrView->currentAlbum(); QString title, icon; QKeySequence ks; - if (!TagEditDlg::tagCreate(kapp->activeWindow(), parent, title, icon, ks)) + if(!parent) + { + parent = static_cast(d->tagMngrView->albumForIndex(d->tagMngrView->model()->index(0,0))); + } + + if (!TagEditDlg::tagCreate(kapp->activeWindow(), parent, title, icon, ks)) { return; }