From 822a1b2a6f8903c662ed3df3a7275af3674b9181 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 17 Jan 2022 09:50:13 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-65722=20=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E9=80=89=E6=8B=A9=E6=8C=89=E9=92=AE=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E5=9B=BE=E6=A0=87=E6=97=B6=E6=97=A0=E5=8F=8D=E5=BA=94?= =?UTF-8?q?=EF=BC=8C=E6=B2=A1=E6=9C=89=E5=87=BA=E7=8E=B0=E5=8E=9F=E7=94=9F?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E9=80=89=E6=8B=A9=E5=99=A8=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=20=E5=90=8C=E6=AD=A5=E5=88=B011.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/ifilechooser/JavaFxNativeFileChooser.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java index 4d36883240..fb6a7e88be 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java +++ b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java @@ -197,7 +197,9 @@ public class JavaFxNativeFileChooser implements FileChooserProvider { private File currentDirectory; public Builder fileSelectionMode(FileSelectionMode fileSelectionMode) { - this.fileSelectionMode = fileSelectionMode; + if (fileSelectionMode != null) { + this.fileSelectionMode = fileSelectionMode; + } return this; } @@ -209,13 +211,17 @@ public class JavaFxNativeFileChooser implements FileChooserProvider { } public Builder filters(FileChooser.ExtensionFilter[] filters) { - this.filters = filters; + if (filters != null) { + this.filters = filters; + } return this; } public Builder filters(ExtensionFilter[] filters) { - for (ExtensionFilter filter : filters) { - this.filters = ArrayUtils.add(this.filters, new FileChooser.ExtensionFilter(filter.getDes(), filter.getExtensions())); + if (filters != null) { + for (ExtensionFilter filter : filters) { + this.filters = ArrayUtils.add(this.filters, new FileChooser.ExtensionFilter(filter.getDes(), filter.getExtensions())); + } } return this; }