Gabriel95 / scalafx

Automatically exported from code.google.com/p/scalafx
Other
0 stars 0 forks source link

"java.util.NoSuchElementException: None.get" in `scalafx.delegate.SFXEnumDelegateCompanion#jfxEnum2sfx` #83

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

A code that checks for DragEvent transfer mode may crash with 
"java.util.NoSuchElementException: None.get"
For instance, something like this
    onDragDone = (event: DragEvent) => {
      if (event.transferMode == TransferMode.MOVE)
        ...

      event.consume()
    }
See also Example 7 in "Drag-and-Drop Feature in JavaFX Applications" 
[[http://docs.oracle.com/javafx/2/drag_drop/jfxpub-drag_drop.htm#BABJGICJ]]]

The problem is that JavaFX may return transferMode as `null` but implicit 
conversion in scalafx.delegate.SFXEnumDelegateCompanion#jfxEnum2sfx cannot 
handle `null` inputs when creating ScalaFX wrapper. When the JavaFX is `null`, 
ScalaFX should also create `null` of appropriate ScalaFX type, in the example 
`scalafx.scene.input.TransferMode`.

Original issue reported on code.google.com by jpsacha on 18 Sep 2013 at 3:19

GoogleCodeExporter commented 8 years ago
This issue was closed by revision 197c86dd4435.

Original comment by jpsacha on 18 Sep 2013 at 3:24