Permalink
Browse files

TextField.setTextFormat(): Return NULL on null input.

Avoids segmentation fault. (lp#880393)
  • Loading branch information...
1 parent 281ebc7 commit c217e622a3c3b9bc3a1b96400cc31e9c774071c8 @diocles committed Oct 23, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/scripting/flash/text/flashtext.cpp
@@ -240,6 +240,9 @@ ASFUNCTIONBODY(TextField,_setTextFormat)
LOG(LOG_NOT_IMPLEMENTED,"setTextFormat with more than one parameter");
TextFormat* tf = Class<TextFormat>::cast(args[0]);
+ if(tf->getObjectType() == T_NULL)
+ return NULL;
+
if(tf->color != NULL)
th->textColor = tf->color->toUInt();

0 comments on commit c217e62

Please sign in to comment.