Skip to content

Commit

Permalink
Avoid error "value isBlank is not a member of String" on Java 1.8 #54
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsacha committed Nov 5, 2021
1 parent de11e4f commit f4c77d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class DirectorySelectionField(val title: String, val ownerWindow: Option[Window]
val button = new Button("Browse") {
onAction = _ => {
val initialPath = path.value
if (!initialPath.isBlank) {
if (initialPath.trim.nonEmpty) {
chooser.initialDirectory = existingOrParent(new File(initialPath))
} else {
val file = new File(OpenDialog.getDefaultDirectory)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class FileSelectionField(val title: String, val ownerWindow: Option[Window]) {
val button = new Button("Browse") {
onAction = _ => {
val initialPath = path.value
if (!initialPath.isBlank) {
if (initialPath.trim.nonEmpty) {
val file = new File(initialPath)
fileChooser.initialFileName = file.getName
if (file.getParentFile.exists()) {
Expand Down

0 comments on commit f4c77d2

Please sign in to comment.