From ca51cfbb9917ea8389714323ff2f01d215708de9 Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Sun, 19 May 2013 18:10:04 +0200 Subject: [PATCH] check for android interface before calling functions of it --- code/smartphone.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/smartphone.js b/code/smartphone.js index da05a914..da15ad63 100644 --- a/code/smartphone.js +++ b/code/smartphone.js @@ -126,7 +126,9 @@ window.runOnSmartphonesAfterBoot = function() { var overlayLayersJSON = JSON.stringify(overlayLayers); var baseLayersJSON = JSON.stringify(baseLayers); - android.setLayers(baseLayersJSON, overlayLayersJSON); + if (typeof android !== 'undefined' && android && android.setLayers) { + android.setLayers(baseLayersJSON, overlayLayersJSON); + } return { baseLayers: baseLayers,