Alembic import: prevent crash when cancelling import.
[blender.git] / source / blender / alembic / intern / alembic_capi.cc
index c16a20899829083d04342294eb1e8f27d95986b1..9529b370928097453677903d50a98b9e736b3ef7 100644 (file)
@@ -766,6 +766,9 @@ static void import_endjob(void *user_data)
                for (iter = data->readers.begin(); iter != data->readers.end(); ++iter) {
                        Object *ob = (*iter)->object();
 
+                       /* It's possible that cancellation occured between the creation of
+                        * the reader and the creation of the Blender object. */
+                       if (ob == NULL) continue;
 
                        BKE_libblock_free_us(data->bmain, ob);
                }