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);