From ff5fb2f4ef8997cb110476f2823b6edfd28cea08 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 10 Jun 2011 12:08:55 +0000 Subject: [PATCH] Bugfix: Text Editor operators crash when invoked from Python/Console --- source/blender/editors/space_text/text_draw.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 625e5561389..28230b7a48b 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -907,9 +907,12 @@ static void text_update_drawcache(SpaceText *st, ARegion *ar) 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) {