From 95c17a190cc08d8e356b17ed4279a788a3b49c39 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Mon, 20 Jun 2016 11:01:49 -0400 Subject: [PATCH] Avoid failure when currentLocation not yet initialised --- js/examples/location/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/examples/location/index.js b/js/examples/location/index.js index 6427ca6..6117642 100644 --- a/js/examples/location/index.js +++ b/js/examples/location/index.js @@ -63,7 +63,9 @@ ground dataspace G { assert toBroker(wsurl, currentLocation) when (currentLocation); on message Syndicate.UI.globalEvent('#my_email', 'change', _) { - localStorage.my_email = currentLocation[1] = email_element.value.trim(); + var v = email_element.value.trim(); + if (currentLocation) currentLocation[1] = v; + localStorage.my_email = v; } on message Syndicate.UI.globalEvent('#group', 'change', _) {