git.gnu.io has moved to IP address 209.51.188.249 -- please double check where you are logging in.

Commit 2e42d333 authored by Evan Prodromou's avatar Evan Prodromou

check before saving a thumbnail

parent f463329b
......@@ -115,7 +115,13 @@ class File_oembed extends Memcached_DataObject
}
$file_oembed->insert();
if (!empty($data->thumbnail_url)) {
File_thumbnail::saveNew($data, $file_id);
$ft = File_thumbnail::staticGet('file_id', $file_id);
if (!empty($ft)) {
common_log(LOG_WARNING, "Strangely, a File_thumbnail object exists for new file $file_id",
__FILE__);
} else {
File_thumbnail::saveNew($data, $file_id);
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment