Fixes an issue that could break saving volumes.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
perCnCopies[cn_id].push(cp);
}
cp.call_number(cn_id); // prevent loops in JSON-ification
- cnHash[cn_id].prefix(cnHash[cn_id].prefix().id()); // un-object-ize some fields
- cnHash[cn_id].suffix(cnHash[cn_id].suffix().id()); // un-object-ize some fields
+ if (typeof cnHash[cn_id].prefix() == 'object')
+ cnHash[cn_id].prefix(cnHash[cn_id].prefix().id()); // un-object-ize some fields
+ if (typeof cnHash[cn_id].suffix() == 'object')
+ cnHash[cn_id].suffix(cnHash[cn_id].suffix().id()); // un-object-ize some fields
});
angular.forEach(perCnCopies, function (v, k) {