From da2c6e8bc82d10a358748d83dabaa963ea64054e Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Tue, 27 Mar 2018 20:41:42 +0200 Subject: [PATCH] Fixes javascript error; .trim() on undefined --- wizard/WizardDaemonSettings.qml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wizard/WizardDaemonSettings.qml b/wizard/WizardDaemonSettings.qml index bec134df..ac19aa87 100644 --- a/wizard/WizardDaemonSettings.qml +++ b/wizard/WizardDaemonSettings.qml @@ -183,7 +183,14 @@ ColumnLayout { opacity: localNode.checked id: bootstrapNodeEdit daemonAddrText: persistentSettings.bootstrapNodeAddress.split(":")[0].trim() - daemonPortText: (persistentSettings.bootstrapNodeAddress.split(":")[1].trim() == "") ? "18081" : persistentSettings.bootstrapNodeAddress.split(":")[1] + daemonPortText: { + var node_split = persistentSettings.bootstrapNodeAddress.split(":"); + if(node_split.length == 2){ + (node_split[1].trim() == "") ? "18081" : node_split[1]; + } else { + return "" + } + } } }