From 1fc7daeaf8c7237078c87703ecd1636318827fb1 Mon Sep 17 00:00:00 2001 From: timbencker Date: Thu, 5 Sep 2024 00:24:13 +0200 Subject: [PATCH] Handle FileChooser cancelation and no selection case --- source/utils/FileChooserManager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/utils/FileChooserManager.cpp b/source/utils/FileChooserManager.cpp index 518eb45..7acd40c 100644 --- a/source/utils/FileChooserManager.cpp +++ b/source/utils/FileChooserManager.cpp @@ -26,6 +26,12 @@ void FileChooserManager::openFileChooser(const juce::String& dialogTitle, juce::File chosen; auto results = chooser.getURLResults(); + // Check if the results are empty (user closed without selecting a file) + if (results.isEmpty()) + { + return; + } + for (const auto& result : results) { if (result.isLocalFile())