From d4663166d6c4703d38302a2a80e1d327ff806ab7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 30 Jan 2010 15:44:11 +0000 Subject: bugfix [#20888] Crash when following instructions on the Blender Wiki and then clicking on the outliner --- source/blender/editors/interface/interface.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 44c943fa4f4..a4a7a7c5bb5 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1491,11 +1491,14 @@ void ui_get_but_string(uiBut *but, char *str, int maxlen) } else if(but->type == IDPOIN) { /* ID pointer */ - ID *id= *(but->idpoin_idpp); - - if(id) BLI_strncpy(str, id->name+2, maxlen); - else BLI_strncpy(str, "", maxlen); - + if(but->idpoin_idpp) { /* Can be NULL for ID properties by python */ + ID *id= *(but->idpoin_idpp); + if(id) + BLI_strncpy(str, id->name+2, maxlen); + } + else { + str[0] = '\0'; + } return; } else if(but->type == TEX) { -- cgit v1.2.3