File tree 2 files changed +11
-1
lines changed 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -392,7 +392,7 @@ angular.module('ngResource', ['ng']).
392
392
actionParams = extend ( { } , paramDefaults , actionParams ) ;
393
393
forEach ( actionParams , function ( value , key ) {
394
394
if ( isFunction ( value ) ) { value = value ( ) ; }
395
- ids [ key ] = value . charAt && value . charAt ( 0 ) == '@' ? getter ( data , value . substr ( 1 ) ) : value ;
395
+ ids [ key ] = value && value . charAt && value . charAt ( 0 ) == '@' ? getter ( data , value . substr ( 1 ) ) : value ;
396
396
} ) ;
397
397
return ids ;
398
398
}
Original file line number Diff line number Diff line change @@ -205,6 +205,16 @@ describe("resource", function() {
205
205
} ) ;
206
206
207
207
208
+ it ( 'should not throw TypeError on null default params' , function ( ) {
209
+ $httpBackend . expect ( 'GET' , '/Path?' ) . respond ( '{}' ) ;
210
+ var R = $resource ( '/Path' , { param : null } , { get : { method : 'GET' } } ) ;
211
+
212
+ expect ( function ( ) {
213
+ R . get ( { } ) ;
214
+ } ) . not . toThrow ( ) ;
215
+ } ) ;
216
+
217
+
208
218
it ( 'should handle multiple params with same name' , function ( ) {
209
219
var R = $resource ( '/:id/:id' ) ;
210
220
You can’t perform that action at this time.
0 commit comments