Do not invoke callback with an empty list

This commit is contained in:
Roman Shevchenko
2012-03-14 20:30:22 +01:00
parent ebed8435d8
commit b6fc858faf
@@ -116,7 +116,9 @@ public class FileChooserDialogImpl extends DialogWrapper implements FileChooserD
@Override
public void choose(@Nullable VirtualFile toSelect, @NotNull Consumer<List<VirtualFile>> callback) {
prepareAndShow(toSelect, myProject);
callback.consume(Arrays.asList(myChosenFiles));
if (myChosenFiles.length > 0) {
callback.consume(Arrays.asList(myChosenFiles));
}
}
private void prepareAndShow(@Nullable VirtualFile toSelect, @Nullable Project project) {