Fixes javascript error; .trim() on undefined

pull/2/head
Sander Ferdinand 6 years ago committed by moneromooo-monero
parent 0bfff8844e
commit da2c6e8bc8

@ -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 ""
}
}
}
}