Protects against a null atext in cloneAText

This commit is contained in:
Francois Cassin 2015-11-10 16:21:43 +01:00
parent f2836125dc
commit 2bd698343a
2 changed files with 12 additions and 5 deletions

View file

@ -1628,10 +1628,12 @@ exports.applyToAText = function (cs, atext, pool) {
* @param atext {AText}
*/
exports.cloneAText = function (atext) {
return {
text: atext.text,
attribs: atext.attribs
};
if (atext) {
return {
text: atext.text,
attribs: atext.attribs
}
} else exports.error("atext is null");
};
/**