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:
@@ -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;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user