From 420237e8dc50945ad9595efbf8b7599988cafbc2 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Thu, 11 Jun 2020 00:08:47 +0200 Subject: [PATCH] Avoid error raised in case of empty scala file --- src/sfizz/Tuning.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/sfizz/Tuning.cpp b/src/sfizz/Tuning.cpp index 6926ba5f..4f14acb8 100644 --- a/src/sfizz/Tuning.cpp +++ b/src/sfizz/Tuning.cpp @@ -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; }