Avoid undefined labels breaking the sort

This commit is contained in:
Nathan Gray 2016-05-02 15:17:20 +00:00
parent cea5c69b7f
commit 86c86fab9f

View File

@ -341,7 +341,7 @@ var et2_calendar_planner = (function(){ "use strict"; return et2_calendar_view.e
{ {
if(already_added.indexOf(''+id) < 0) if(already_added.indexOf(''+id) < 0)
{ {
this.push({id: id, label: result[id], data: {participants:id,owner:id}}); this.push({id: id, label: result[id]||'', data: {participants:id,owner:id}});
already_added.push(''+id); already_added.push(''+id);
} }
} }
@ -349,7 +349,7 @@ var et2_calendar_planner = (function(){ "use strict"; return et2_calendar_view.e
} }
else // users else // users
{ {
var label = this._get_owner_name(user); var label = this._get_owner_name(user)||'';
if(already_added.indexOf(user) < 0) if(already_added.indexOf(user) < 0)
{ {
labels.push({id: user, label: label, data: {participants:user,owner:''}}); labels.push({id: user, label: label, data: {participants:user,owner:''}});