From 62daf6a463a4df6b1931a5b2ff261a64d7547a55 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Sat, 4 Feb 2017 21:01:20 +0000 Subject: [PATCH] Fix parsing error with no masterlist present --- src/api/api_database.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/api/api_database.cpp b/src/api/api_database.cpp index 8b123f62..a9aeb64a 100644 --- a/src/api/api_database.cpp +++ b/src/api/api_database.cpp @@ -46,10 +46,12 @@ void ApiDatabase::LoadLists(const std::string& masterlistPath, Masterlist temp; MetadataList userTemp; - if (boost::filesystem::exists(masterlistPath)) { - temp.Load(masterlistPath); - } else { - throw FileAccessError("The given masterlist path does not exist: " + masterlistPath); + if (!masterlistPath.empty()) { + if (boost::filesystem::exists(masterlistPath)) { + temp.Load(masterlistPath); + } else { + throw FileAccessError("The given masterlist path does not exist: " + masterlistPath); + } } if (!userlistPath.empty()) { @@ -95,7 +97,6 @@ void ApiDatabase::WriteUserMetadata(const std::string& outputFile, const bool ov // LOOT Functionality Functions //////////////////////////////////// - bool ApiDatabase::UpdateMasterlist(const std::string& masterlistPath, const std::string& remoteURL, const std::string& remoteBranch) {