Skip to content

Commit

Permalink
Handle FileChooser cancelation and no selection case
Browse files Browse the repository at this point in the history
  • Loading branch information
timbencker committed Sep 4, 2024
1 parent 1e926ee commit 1fc7dae
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source/utils/FileChooserManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 1fc7dae

Please sign in to comment.