Minor: fix a DemoBench crash that can occur if the web server fails to start.

This commit is contained in:
Mike Hearn 2017-08-10 13:14:34 +02:00
parent fa0cdeed2d
commit 5cda7e30d5

View File

@ -166,17 +166,15 @@ class NodeTerminalView : Fragment() {
webServer.open(config).then {
Platform.runLater {
launchWebButton.graphic = null
}
it.match({
log.info("Web server for ${config.legalName} started on $it")
Platform.runLater {
it.match(success = {
log.info("Web server for ${config.legalName} started on $it")
webURL = it
launchWebButton.text = "Reopen\nweb site"
app.hostServices.showDocument(it.toString())
}
}, {
launchWebButton.text = oldLabel
})
}, failure = {
launchWebButton.text = oldLabel
})
}
}
}
}