diff --git a/distrho/extra/FileBrowserDialog.cpp b/distrho/extra/FileBrowserDialog.cpp index a512f72a..ccaa4f1b 100644 --- a/distrho/extra/FileBrowserDialog.cpp +++ b/distrho/extra/FileBrowserDialog.cpp @@ -576,7 +576,11 @@ void fileBrowserClose(const FileBrowserHandle handle) const char* fileBrowserGetPath(const FileBrowserHandle handle) { - return handle->selectedFile != kSelectedFileCancelled ? handle->selectedFile : nullptr; + if (const char* const selectedFile = handle->selectedFile) + if (selectedFile != kSelectedFileCancelled && std::strcmp(selectedFile, kSelectedFileCancelled) != 0) + return selectedFile; + + return nullptr; } // --------------------------------------------------------------------------------------------------------------------