From f372bd3fd18d3e56e09d1309a631f72556424efe Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Fri, 3 Apr 2009 23:58:16 +0000 Subject: [PATCH] Wrapping json.write in a try/catch to guard against possible failures reported in one case on IE. If anybody cares to get to the bottom of this properly, see the test case attached to the ticket. r=me (closes #1826) git-svn-id: http://svn.openlayers.org/trunk/openlayers@9182 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Format/JSON.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/OpenLayers/Format/JSON.js b/lib/OpenLayers/Format/JSON.js index 609b7b03b2..6b3a4613d8 100644 --- a/lib/OpenLayers/Format/JSON.js +++ b/lib/OpenLayers/Format/JSON.js @@ -157,7 +157,11 @@ OpenLayers.Format.JSON = OpenLayers.Class(OpenLayers.Format, { var json = null; var type = typeof value; if(this.serialize[type]) { - json = this.serialize[type].apply(this, [value]); + try { + json = this.serialize[type].apply(this, [value]); + } catch(err) { + OpenLayers.Console.error("Trouble serializing: " + err); + } } return json; },