From 3344a34b7c5aadeb82fc7151bb6b2677ebd2f732 Mon Sep 17 00:00:00 2001 From: drw Date: Mon, 03 Jan 2005 21:04:08 +0000 Subject: Fix crash when trying to display open text dialog when there are no modules in configured directory --- (limited to 'noncore/apps') diff --git a/noncore/apps/dagger/opentextdlg.cpp b/noncore/apps/dagger/opentextdlg.cpp index f7893a9..8c94a4b 100644 --- a/noncore/apps/dagger/opentextdlg.cpp +++ b/noncore/apps/dagger/opentextdlg.cpp @@ -61,24 +61,27 @@ OpenTextDlg::OpenTextDlg( QWidget *parent, sword::SWMgr *swordMgr, QPixmap *bibl for ( it = swordMgr->Modules.begin(); it != swordMgr->Modules.end(); it++ ) { - type = it->second->Type(); - if ( type == "Biblical Texts" ) + if ( it->second ) { - icon = bibleIcon; - parent = m_bibles; + type = it->second->Type(); + if ( type == "Biblical Texts" ) + { + icon = bibleIcon; + parent = m_bibles; + } + else if ( type == "Commentaries" ) + { + icon = commentaryIcon; + parent = m_commentaries; + } + else if ( type == "Lexicons / Dictionaries" ) + { + icon = lexiconIcon; + parent = m_lexicons; + } + + parent->insertItem( new QListViewItem( parent, QString::null, it->first.c_str() ) ); } - else if ( type == "Commentaries" ) - { - icon = commentaryIcon; - parent = m_commentaries; - } - else if ( type == "Lexicons / Dictionaries" ) - { - icon = lexiconIcon; - parent = m_lexicons; - } - - parent->insertItem( new QListViewItem( parent, QString::null, it->first.c_str() ) ); } } -- cgit v0.9.0.2