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,20 +166,18 @@ class NodeTerminalView : Fragment() {
webServer.open(config).then { webServer.open(config).then {
Platform.runLater { Platform.runLater {
launchWebButton.graphic = null launchWebButton.graphic = null
} it.match(success = {
it.match({
log.info("Web server for ${config.legalName} started on $it") log.info("Web server for ${config.legalName} started on $it")
Platform.runLater {
webURL = it webURL = it
launchWebButton.text = "Reopen\nweb site" launchWebButton.text = "Reopen\nweb site"
app.hostServices.showDocument(it.toString()) app.hostServices.showDocument(it.toString())
} }, failure = {
}, {
launchWebButton.text = oldLabel launchWebButton.text = oldLabel
}) })
} }
} }
} }
}
private fun launchRPC(config: NodeConfig) = NodeRPC( private fun launchRPC(config: NodeConfig) = NodeRPC(
config = config, config = config,