diff options
author | Gaia Clary <gaia.clary@machinimatrix.org> | 2012-07-10 02:41:44 +0400 |
---|---|---|
committer | Gaia Clary <gaia.clary@machinimatrix.org> | 2012-07-10 02:41:44 +0400 |
commit | f3fa96303bf98118d4921640d82e629e97c28ee5 (patch) | |
tree | 4664c68e93d5afa1b2590c217fc48339293f0bd8 /source/blender | |
parent | 24f672d57b75e7ed0cf1bc1ea20ec598fcfb4f6e (diff) |
Fixed an exception during image export when a source image does not exist in the file system
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/collada/ImageExporter.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/collada/ImageExporter.cpp b/source/blender/collada/ImageExporter.cpp index e86388f31fb..206dc09fe8b 100644 --- a/source/blender/collada/ImageExporter.cpp +++ b/source/blender/collada/ImageExporter.cpp @@ -63,6 +63,11 @@ void ImagesExporter::export_UV_Image(Image *image, bool use_copies) if (not_yet_exported) { ImBuf *imbuf = BKE_image_get_ibuf(image, NULL); + if(!imbuf) { + fprintf(stderr, "Collada export: image does not exist:\n%s\n", image->name); + return; + } + bool is_dirty = imbuf->userflags & IB_BITMAPDIRTY; ImageFormatData imageFormat; @@ -100,6 +105,7 @@ void ImagesExporter::export_UV_Image(Image *image, bool use_copies) if (BKE_imbuf_write_as(imbuf, export_path, &imageFormat, true) == 0) { fprintf(stderr, "Collada export: Cannot export image to:\n%s\n", export_path); + return; } BLI_strncpy(export_path, export_file, sizeof(export_path)); } @@ -119,6 +125,7 @@ void ImagesExporter::export_UV_Image(Image *image, bool use_copies) if (BLI_copy(source_path, export_path) != 0) { fprintf(stderr, "Collada export: Cannot copy image:\n source:%s\ndest :%s\n", source_path, export_path); + return; } BLI_strncpy(export_path, export_file, sizeof(export_path)); |