From 60d5ea7ab6aeddeffb249c5c53e8a8dd4b36c1f3 Mon Sep 17 00:00:00 2001 From: cc9cii Date: Sat, 19 Dec 2015 20:57:29 +1100 Subject: [PATCH] Fix bug where new addons could not be created since commit ff072441fde05d189cb06cb44cc9c360690c2f09. --- apps/opencs/model/world/data.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/opencs/model/world/data.cpp b/apps/opencs/model/world/data.cpp index 64d317bd41..7214e7e34e 100644 --- a/apps/opencs/model/world/data.cpp +++ b/apps/opencs/model/world/data.cpp @@ -3,6 +3,8 @@ #include #include +#include + #include #include @@ -905,9 +907,12 @@ int CSMWorld::Data::getTotalRecords (const std::vector& for (unsigned int i = 0; i < files.size(); ++i) { - reader->open(files[i].string()); - records += reader->getRecordCount(); - reader->close(); + if (boost::filesystem::exists(files[i].string())) + { + reader->open(files[i].string()); + records += reader->getRecordCount(); + reader->close(); + } } return records; @@ -1113,7 +1118,7 @@ bool CSMWorld::Data::continueLoading (CSMDoc::Messages& messages) else { mTopics.load (record, mBase); - mDialogue = &mTopics.getRecord (record.mId).get(); + mDialogue = &mTopics.getRecord (record.mId).get(); } }