diff options
author | Joshua Leung <aligorith@gmail.com> | 2011-06-10 16:08:55 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2011-06-10 16:08:55 +0400 |
commit | ff5fb2f4ef8997cb110476f2823b6edfd28cea08 (patch) | |
tree | e2980e6565d1d7107b89e21daa852a58744f7134 /source/blender/editors/space_text | |
parent | ee713387242e992fdb8d87897193a6946fd1d0c0 (diff) |
Bugfix: Text Editor operators crash when invoked from Python/Console
Diffstat (limited to 'source/blender/editors/space_text')
-rw-r--r-- | source/blender/editors/space_text/text_draw.c | 9 |
1 files 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) { |