anvilresearch/modinha

Initializing an object containing a null valued propery from a mapping causes an error

Closed this issue · 1 comments

var AccessToken = Modinha.define('accesstokens', {
  // ...
})

AccessToken.mappings.exchange = {      
  'cid':   'client_id',   
  'uid':   'user_id',                                                                
  'ei':    'max_age',                
  'scope': 'scope'    
};

// THIS CAUSES AN ERROR
AccessToken.initialize({
  client_id: null
}, {
  mapping: 'exchange' 
});

// TypeError: Cannot read property 'undefined' of null

Unable to replicate this bug in the current version of Modinha. Closing issue; feel free to reopen if I'm mistaken