summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <cb15g11@soton.ac.uk>2014-09-06 13:06:02 +0100
committerChristopher Baines <cb15g11@soton.ac.uk>2014-09-06 13:06:02 +0100
commit6efe207d14c79229cb4c02ffd56270ad05f671ce (patch)
treeb29be8bd7d4f9386a8e490299aa497724f508171
parent0c8f13133109b7f954f145c4a22cd332ed5e4b35 (diff)
downloadleaflet-soton-6efe207d14c79229cb4c02ffd56270ad05f671ce.tar
leaflet-soton-6efe207d14c79229cb4c02ffd56270ad05f671ce.tar.gz
Fix bug with fixing workstation data
Do not try and process null data if data already exists.
-rw-r--r--src/leaflet-soton.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/leaflet-soton.js b/src/leaflet-soton.js
index a90c163..b9818bc 100644
--- a/src/leaflet-soton.js
+++ b/src/leaflet-soton.js
@@ -214,10 +214,13 @@ SELECT * WHERE {\
url: 'http://sparql.data.southampton.ac.uk/?query=' + encodeURIComponent(query)
},
function(data) {
- // Only report no data if fetching data failed, and there
- // is no local data
- if (data === null && LS.workstationData === null) {
- LS.fire("workstationData", null);
+ // If fetching data has failed
+ if (data === null) {
+ // Only report this if there is no existing data
+ if (LS.workstationData === null) {
+ LS.fire("workstationData", null);
+ }
+
return;
}