dev/core#351 - Fix $.crmSnippet error with no url args
authorColeman Watts <coleman@civicrm.org>
Tue, 28 Aug 2018 12:24:37 +0000 (08:24 -0400)
committerColeman Watts <coleman@civicrm.org>
Tue, 28 Aug 2018 12:24:37 +0000 (08:24 -0400)
js/crm.ajax.js

index e1742da8fd9873c3bd318435de350b867686df80..5a1155c8462bd2a24a1e90d91eefc77628be87db 100644 (file)
         return false;
       }
       // Compare arguments
-      $.each(newUrl.split('?')[1].split('&'), function(k, v) {
+      $.each((newUrl.split('?')[1] || '').split('&'), function(k, v) {
         var arg = v.split('=');
         args[arg[0]] = arg[1];
       });
-      $.each(oldUrl.split('?')[1].split('&'), function(k, v) {
+      $.each((oldUrl.split('?')[1] || '').split('&'), function(k, v) {
         var arg = v.split('=');
         if (args[arg[0]] !== undefined && arg[1] !== args[arg[0]]) {
           same = false;