From dade124703b0bfd9a05a5f20e45f2622bb09c177 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Sun, 24 Oct 2021 18:35:45 +0200 Subject: [PATCH] jsfx: check the file name for existence --- source/backend/plugin/CarlaPluginJSFX.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/backend/plugin/CarlaPluginJSFX.cpp b/source/backend/plugin/CarlaPluginJSFX.cpp index cea21c887..b6b080b55 100644 --- a/source/backend/plugin/CarlaPluginJSFX.cpp +++ b/source/backend/plugin/CarlaPluginJSFX.cpp @@ -858,11 +858,13 @@ public: if (const char* paths = pData->engine->getOptions().pathJSFX) splitPaths = StringArray::fromTokens(CharPointer_UTF8(paths), CARLA_OS_SPLIT_STR, ""); + File file; if (filename && filename[0] != '\0') + file = File(CharPointer_UTF8(filename)); + + if (file.isNotNull() && file.existsAsFile()) { // find which engine search path we're in, and use this as the root - const File file = File(CharPointer_UTF8(filename)); - for (int i = 0; i < splitPaths.size() && !unit; ++i) { const File currentPath(splitPaths[i]);