diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-06-28 03:01:33 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-06-28 03:01:33 +0400 |
commit | f9ae102afd4a6dd03a028127c2e2b4f99ae8cf57 (patch) | |
tree | 9822c0a276413a7bcca2615c7c451d5449a56b65 /source/blender/src | |
parent | f0a3cbcdac4c7f84daef7c33e858a10277400a5f (diff) |
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.
Diffstat (limited to 'source/blender/src')
-rw-r--r-- | source/blender/src/editfont.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; |