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
This commit is contained in:
Tim Schaub
2009-04-03 23:58:16 +00:00
parent b0f71c2702
commit f372bd3fd1

View File

@@ -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;
},