From 7c9b4e6f9a327551fca2d7bde951c4598cb0244b Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Mon, 9 Aug 2004 18:25:08 +0000 Subject: [PATCH] Fix for #1509 Running the system info script with a text window (empty) open caused dereferencing of a null-pointer with obviously unwanted results. Catching the possible situation before it happens. --- source/blender/python/api2_2x/Window.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/source/blender/python/api2_2x/Window.c b/source/blender/python/api2_2x/Window.c index fd66819b0d5..9acf91211f4 100644 --- a/source/blender/python/api2_2x/Window.c +++ b/source/blender/python/api2_2x/Window.c @@ -371,14 +371,16 @@ PyObject *M_Window_Redraw(PyObject *self, PyObject *args) if (sa->spacetype == wintype || redraw_all) { if (sa->spacetype == SPACE_TEXT) { st = sa->spacedata.first; - if (st->text->flags & TXT_FOLLOW) /* follow cursor display */ - pop_space_text(st); - - // XXX making a test: Jul 07, 2004. - // we don't need to prevent text win redraws anymore, - // since now there's a scripts space instead. - //if (EXPP_disable_force_draw) { /* defined in Draw.[ch] ... */ - // scrarea_queue_redraw(sa); + if(st->text) { + if (st->text->flags & TXT_FOLLOW) /* follow cursor display */ + pop_space_text(st); + + // XXX making a test: Jul 07, 2004. + // we don't need to prevent text win redraws anymore, + // since now there's a scripts space instead. + //if (EXPP_disable_force_draw) { /* defined in Draw.[ch] ... */ + // scrarea_queue_redraw(sa); + } } //} else {