Make the image open operator work even if there's no scene in context.

This commit is contained in:
Martin Poirier
2010-01-08 03:55:06 +00:00
parent b517ceb374
commit 59a8c295c6

View File

@@ -649,7 +649,8 @@ static int open_exec(bContext *C, wmOperator *op)
char str[FILE_MAX];
RNA_string_get(op->ptr, "path", str);
ima= BKE_add_image_file(str, scene->r.cfra);
/* default to frame 1 if there's no scene in context */
ima= BKE_add_image_file(str, scene ? scene->r.cfra : 1);
if(!ima) {
if(op->customdata) MEM_freeN(op->customdata);