From kde-commits Wed Jan 13 22:04:19 2010 From: Frederik Gladhorn Date: Wed, 13 Jan 2010 22:04:19 +0000 To: kde-commits Subject: branches/KDE/4.4/kdeedu/kwordquiz/src Message-Id: <1263420259.883928.11456.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=126342026923505 SVN commit 1074343 by gladhorn: backport r 1074340 - don't crash when file has < 2 identifiers M +4 -0 kwordquiz.cpp --- branches/KDE/4.4/kdeedu/kwordquiz/src/kwordquiz.cpp #1074342:1074343 @@ -585,6 +585,10 @@ if (!url.isEmpty() && KIO::NetAccess::exists(url, KIO::NetAccess::SourceSide, this)) { int result = m_doc->open(url); if (result == KEduVocDocument::NoError) { + while (m_doc->identifierCount() < 2) { //if we opened a TAB-less CSV, there + m_doc->appendIdentifier(); //may be 0 or 1 identifiers, we need at least 2 + } + m_tableModel->reset(); m_dirWatch->addFile(url.path()); setCaption(m_doc->url().fileName(), false);