aboutsummaryrefslogtreecommitdiffstats
path: root/src/core.js
diff options
context:
space:
mode:
authorjaubourg <j@ubourg.net>2012-03-07 17:37:14 +0100
committerjaubourg <j@ubourg.net>2012-03-07 17:37:14 +0100
commitd30859eb6bd5af9aafa9db003e17835ff594d019 (patch)
tree8c1063cbc91b2dd4d363c0a7ab454b3e0d8bad6e /src/core.js
parentbd56456b1e886c7b03211212ac3c0a6a310b5cde (diff)
downloadjquery-d30859eb6bd5af9aafa9db003e17835ff594d019.tar.gz
jquery-d30859eb6bd5af9aafa9db003e17835ff594d019.zip
Makes parseXML act like parseJSON when given an empty or non-string input: now returns null rather than throwing an exception. Incidently fixes #10527. Unit tests added.
Diffstat (limited to 'src/core.js')
-rw-r--r--src/core.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core.js b/src/core.js
index 9a551446b..9c8314c91 100644
--- a/src/core.js
+++ b/src/core.js
@@ -557,6 +557,9 @@ jQuery.extend({
// Cross-browser xml parsing
parseXML: function( data ) {
+ if ( typeof data !== "string" || !data ) {
+ return null;
+ }
var xml, tmp;
try {
if ( window.DOMParser ) { // Standard