Skip to content

Instantly share code, notes, and snippets.

@cybrown
Created August 8, 2013 12:33
Show Gist options
  • Select an option

  • Save cybrown/6184181 to your computer and use it in GitHub Desktop.

Select an option

Save cybrown/6184181 to your computer and use it in GitHub Desktop.
Fix for old android JSON.parse.
if (window.JSON && window.JSON.parse) {
try {
JSON.parse(null);
} catch (e) {
var originalParse = JSON.parse;
JSON.parse = function(value) {
if (value) {
return originalParse(value);
} else {
return value;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment