Avoid error raised in case of empty scala file

This commit is contained in:
Jean Pierre Cimalando 2020-06-11 00:08:47 +02:00
parent a369d61b78
commit 420237e8dc

View file

@ -177,6 +177,11 @@ bool Tuning::loadScalaFile(const fs::path& path)
return false;
}
if (scl.count <= 0) {
DBG("The scale file is empty: " << path);
return false;
}
impl_->updateScale(scl, path);
return true;
}
@ -194,6 +199,11 @@ bool Tuning::loadScalaString(const std::string& text)
return false;
}
if (scl.count <= 0) {
DBG("The scale file is empty: " << path);
return false;
}
impl_->updateScale(scl);
return true;
}