Handle unsupported selections in thumbnails traverser
authorThierry Florac <thierry.florac@onf.fr>
Tue, 26 Mar 2019 16:41:05 +0100
changeset 201 50a5119ee57d
parent 200 a9225c2f8870
child 202 a9702e034100
Handle unsupported selections in thumbnails traverser
src/pyams_file/thumbnail.py
--- a/src/pyams_file/thumbnail.py	Mon Feb 18 16:11:42 2019 +0100
+++ b/src/pyams_file/thumbnail.py	Tue Mar 26 16:41:05 2019 +0100
@@ -255,8 +255,9 @@
         if ':' in thumbnail_name:
             selection_name, thumbnail_name = thumbnail_name.split(':', 1)
             selection = thumbnails.get_selection(selection_name, format)
-            transaction.commit()
-            thumbnails = IThumbnails(selection)
+            if selection is not None:
+                transaction.commit()
+                thumbnails = IThumbnails(selection)
         result = thumbnails.get_thumbnail(thumbnail_name, format)
         transaction.commit()
         return result