Skip to content

Commit

Permalink
temporary patch for an odd bug (scalafx/scalafx/issues/178)
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanHargrave committed Jan 25, 2015
1 parent 898354e commit fc3a829
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/main/scala/info/hargrave/composer/ui/FXPromptInterface.scala
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,19 @@ final class FXPromptInterface extends PromptInterface {
}
}

val result = Option( multipleFiles match {
val dialogResponse = multipleFiles match {
case true =>
chooser.showOpenMultipleDialog(null)
try {
chooser.showOpenMultipleDialog(null)
} catch {
case _:NullPointerException => null // See scalafx/scalafx issue #178 on github
}
case false =>
val selected = chooser.showOpenDialog(null)
if(selected == null) Seq(selected) else null
} )
}

val result = Option(dialogResponse)

/*
* This is a (hacky?) solution that allows us to continue to prompt the user for a file selection if the caller
Expand Down

0 comments on commit fc3a829

Please sign in to comment.