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.
This commit is contained in:
parent
f0a3cbcdac
commit
f9ae102afd
@ -942,7 +942,8 @@ char *txt_to_buf (Text *text)
|
||||
if (!text) return NULL;
|
||||
if (!text->curl) return NULL;
|
||||
if (!text->sell) return NULL;
|
||||
|
||||
if (!text->lines.first) return NULL;
|
||||
|
||||
linef= text->lines.first;
|
||||
charf= 0;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user