From f9ae102afd4a6dd03a028127c2e2b4f99ae8cf57 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 27 Jun 2008 23:01:33 +0000 Subject: bugfix, txt_to_buf would crash on an empty text file. Also checked all other uses of text->lines.first to make sure the assumption isn't made elsewhere. Added 2 more checks for text->lines.first when converting text buffer to objects. --- source/blender/src/editfont.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/src') diff --git a/source/blender/src/editfont.c b/source/blender/src/editfont.c index cb245867c89..a3b05a008c8 100644 --- a/source/blender/src/editfont.c +++ b/source/blender/src/editfont.c @@ -354,7 +354,7 @@ void txt_export_to_object(struct Text *text) // char sdir[FILE_MAXDIR]; // char sfile[FILE_MAXFILE]; - if(!text) return; + if(!text || !text->lines.first) return; id = (ID *)text; @@ -429,7 +429,7 @@ void txt_export_to_objects(struct Text *text) int linenum = 0; float offset[3] = {0.0,0.0,0.0}; - if(!text) return; + if(!text || !text->lines.first) return; id = (ID *)text; -- cgit v1.2.3