[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37364] branches/soc-2011-pepper/source/ blender/editors/space_text/text_draw.c: Bugfix: Text Editor operators crash when invoked from Python/Console

Joshua Leung aligorith at gmail.com
Fri Jun 10 14:08:55 CEST 2011


Revision: 37364
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37364
Author:   aligorith
Date:     2011-06-10 12:08:55 +0000 (Fri, 10 Jun 2011)
Log Message:
-----------
Bugfix: Text Editor operators crash when invoked from Python/Console

Modified Paths:
--------------
    branches/soc-2011-pepper/source/blender/editors/space_text/text_draw.c

Modified: branches/soc-2011-pepper/source/blender/editors/space_text/text_draw.c
===================================================================
--- branches/soc-2011-pepper/source/blender/editors/space_text/text_draw.c	2011-06-10 10:13:50 UTC (rev 37363)
+++ branches/soc-2011-pepper/source/blender/editors/space_text/text_draw.c	2011-06-10 12:08:55 UTC (rev 37364)
@@ -907,9 +907,12 @@
 
 void text_drawcache_tag_update(SpaceText *st, int full)
 {
-	DrawCache *drawcache= (DrawCache *)st->drawcache;
-
-	if(drawcache) {
+	/* this happens if text editor ops are caled from python */
+	if (st == NULL)
+		return;
+		
+	if(st->drawcache) {
+		DrawCache *drawcache= (DrawCache *)st->drawcache;
 		Text *txt= st->text;
 
 		if(drawcache->update_flag) {




More information about the Bf-blender-cvs mailing list