aboutsummaryrefslogtreecommitdiffstats
path: root/src/ngResource
diff options
context:
space:
mode:
authorRyan Schumacher2013-04-03 10:40:16 -0500
committerIgor Minar2013-05-16 14:26:08 -0700
commitcefbcd470d4c9020cc3487b2326d45058ef831e2 (patch)
treeaafaaf17f9b3d1743e897f8dc2a3e07de6c658d0 /src/ngResource
parentf9b897de4b5cc438515cbb54519fbdf6242f5858 (diff)
downloadangular.js-cefbcd470d4c9020cc3487b2326d45058ef831e2.tar.bz2
fix($resource): null default param results in TypeError
Fixes issue when setting a default param as `null` error `TypeError: Cannot read property 'charAt' of null`
Diffstat (limited to 'src/ngResource')
-rw-r--r--src/ngResource/resource.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ngResource/resource.js b/src/ngResource/resource.js
index a2e915e8..c165ffab 100644
--- a/src/ngResource/resource.js
+++ b/src/ngResource/resource.js
@@ -392,7 +392,7 @@ angular.module('ngResource', ['ng']).
actionParams = extend({}, paramDefaults, actionParams);
forEach(actionParams, function(value, key){
if (isFunction(value)) { value = value(); }
- ids[key] = value.charAt && value.charAt(0) == '@' ? getter(data, value.substr(1)) : value;
+ ids[key] = value && value.charAt && value.charAt(0) == '@' ? getter(data, value.substr(1)) : value;
});
return ids;
}