(js) Check for undefined message flags
parent
557797d634
commit
315117b029
|
@ -66,9 +66,11 @@
|
||||||
else {
|
else {
|
||||||
// Flatten new tags when coming from the predefined list of tags (Message.$tags) and
|
// Flatten new tags when coming from the predefined list of tags (Message.$tags) and
|
||||||
// sync tags with server when adding or removing a tag.
|
// sync tags with server when adding or removing a tag.
|
||||||
$scope.$watchCollection('viewer.message.flags', function(newTags, oldTags) {
|
$scope.$watchCollection('viewer.message.flags', function(_newTags, _oldTags) {
|
||||||
var tags;
|
var newTags, oldTags, tags;
|
||||||
if (newTags || oldTags) {
|
if (_newTags || _oldTags) {
|
||||||
|
newTags = _newTags || [];
|
||||||
|
oldTags = _oldTags || [];
|
||||||
_.forEach(newTags, function(tag, i) {
|
_.forEach(newTags, function(tag, i) {
|
||||||
if (angular.isObject(tag))
|
if (angular.isObject(tag))
|
||||||
newTags[i] = tag.name;
|
newTags[i] = tag.name;
|
||||||
|
|
Loading…
Reference in New Issue