Skip to content

Commit

Permalink
🐛 Fix crash when cancel file chooser
Browse files Browse the repository at this point in the history
  • Loading branch information
devkanro committed Sep 7, 2022
1 parent ad1bc3e commit 5d98b29
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ fun ServerRuleView(vm: ConfigViewModel) {
approveButtonToolTipText = "Select proto root path"
}
fileChooser.showOpenDialog(window)
fileChooser.selectedFile.toPath().toString()
fileChooser.selectedFile?.toPath()?.toString()
}, Modifier.height(0.dp).weight(1.0f).fillMaxWidth())
}
}
Expand All @@ -449,7 +449,9 @@ fun ServerRuleView(vm: ConfigViewModel) {
PathsView(vm, rule.descriptors, {
val dialog = FileDialog(window, "Select", FileDialog.LOAD)
dialog.isVisible = true
Path.of(dialog.directory, dialog.file).toString()
dialog.file?.let {
Path.of(dialog.directory, dialog.file).toString()
}
}, Modifier.height(0.dp).weight(1.0f).fillMaxWidth())
}
}
Expand Down

0 comments on commit 5d98b29

Please sign in to comment.