Fixed replace creating a new image instead of replacing, fixed null source causing repalce error

This commit is contained in:
Matthew Barbour 2020-02-24 14:40:08 +00:00
parent 30761e6d1f
commit ea96f415c5

View File

@ -180,11 +180,13 @@ class ImageIO extends Extension
throw new ImageReplaceException($error);
}
if (strlen(trim($image->source)) == 0) {
if (strlen(trim($image->source ?? '')) == 0) {
$image->source = $existing->get_source();
}
// Update the data in the database.
$image->id = $id;
send_event(new MediaCheckPropertiesEvent($image));
$image->save_to_db();
/*