Fix parsing error with no masterlist present

This commit is contained in:
Oliver Hamlet
2017-02-06 18:03:18 +00:00
parent 93a47e517e
commit 62daf6a463
+6 -5
View File
@@ -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) {