only set source if needed

This commit is contained in:
Shish 2023-01-30 23:41:41 +00:00
parent d268380e95
commit 22fb8b3b3c

View file

@ -183,7 +183,9 @@ class ImageIO extends Extension
$tags_to_set = $image->get_tag_array();
$image->tag_array = [];
send_event(new TagSetEvent($image, $tags_to_set));
send_event(new SourceSetEvent($image, $image->source));
if ($image->source) {
send_event(new SourceSetEvent($image, $image->source));
}
} catch (ImageAdditionException $e) {
throw new UploadException($e->error);
}