Adjust id handling to deal with 0 and null

This commit is contained in:
Chris S 2014-10-22 11:35:25 -05:00
parent cff0e15936
commit f678107859
1 changed files with 2 additions and 2 deletions

View File

@ -353,9 +353,9 @@ module.exports = function(Role) {
context.principals.forEach(function(p) {
// Check against the role mappings
var principalType = p.type || undefined;
var principalId = p.id || undefined;
var principalId = p.id == null ? undefined : p.id;
if(typeof principalId !== 'string' && typeof principalId !== 'undefined') {
if(typeof principalId !== 'string' && principalId != null) {
principalId = principalId.toString();
}