Fixed "undefined" style bug causing crashes

This commit is contained in:
Zeke Chan 2024-07-19 11:06:23 +08:00
parent 99260d2174
commit 5d74999620

View file

@ -395,7 +395,7 @@ var TextStyle = new Class({
// Callback & scope should be set without processing the values
this[key] = GetValue(style, propertyMap[key][0], value);
}
else if (key === 'fontSize' && typeof style.fontSize === 'number')
else if (style && key === 'fontSize' && typeof style.fontSize === 'number')
{
this[key] = style.fontSize.toString() + 'px';
}