diff options
author | Steve Clay <steve@mrclay.org> | 2012-04-10 12:04:03 -0400 |
---|---|---|
committer | Steve Clay <steve@mrclay.org> | 2012-04-10 12:04:03 -0400 |
commit | 4a447a9cfe118373f3b5e7ec35382239455d1541 (patch) | |
tree | a2292c98824260a44457467577ccd31c9abab398 /actions/videolist/edit.php | |
parent | d2bb8789a80215708517f4ffc88462382ec601a8 (diff) | |
download | elgg-4a447a9cfe118373f3b5e7ec35382239455d1541.tar.gz elgg-4a447a9cfe118373f3b5e7ec35382239455d1541.tar.bz2 |
Don't try to load null when there's no thumbnail URL
Diffstat (limited to 'actions/videolist/edit.php')
-rw-r--r-- | actions/videolist/edit.php | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/actions/videolist/edit.php b/actions/videolist/edit.php index 4b96720d8..a5e6ea453 100644 --- a/actions/videolist/edit.php +++ b/actions/videolist/edit.php @@ -80,16 +80,19 @@ if ($video->save()) { elgg_clear_sticky_form('videolist');
// Let's save the thumbnail in the data folder
- $thumbnail = file_get_contents($video->thumbnail);
- if ($thumbnail) {
- $prefix = "videolist/" . $video->guid;
- $filehandler = new ElggFile();
- $filehandler->owner_guid = $video->owner_guid;
- $filehandler->setFilename($prefix . ".jpg");
- $filehandler->open("write");
- $filehandler->write($thumbnail);
- $filehandler->close();
- }
+ $thumb_url = $video->thumbnail;
+ if ($thumb_url) {
+ $thumbnail = file_get_contents($thumb_url);
+ if ($thumbnail) {
+ $prefix = "videolist/" . $video->guid;
+ $filehandler = new ElggFile();
+ $filehandler->owner_guid = $video->owner_guid;
+ $filehandler->setFilename($prefix . ".jpg");
+ $filehandler->open("write");
+ $filehandler->write($thumbnail);
+ $filehandler->close();
+ }
+ }
system_message(elgg_echo('videolist:saved'));
|