Async FileChooser : detect when cancelled in save mode

When using browseForFileToSave, the FileChooser returns false when the user cancels the dialog. But I can’t seem to find an equivalent when using launchAsync in save mode. Checking for File::existsAsFile() returns false, so the only workaround I have found is to check for an empty file name. Is there a better way to handle this?

chooser->launchAsync(juce::FileBrowserComponent::saveMode | juce::FileBrowserComponent::canSelectFiles |
                       [this](const juce::FileChooser& c) {
                         auto f = c.getResult();
                         if (f.getFileName().isNotEmpty()) {
                           const auto t = pluginState.copyState();
                           auto xml = t.createXml();
                           if (xml != nullptr) {
                             currentName = f.getFileNameWithoutExtension();

I just took a quick look at how Projucer uses launchAsync, and it looks like checking for an empty file object the method one should use. if (fc.getResult() == File{}). I suspect that hasn’t been updated in a bit, and these days one can just use {} instead of File{}.

Thanks @cpr2323 , that looks cleaner.