diff --git a/include/image.php b/include/image.php index 3ca29fb..16e45dc 100644 --- a/include/image.php +++ b/include/image.php @@ -391,7 +391,9 @@ class Image { */ function delete() { - unlink($this->sFile); + // if the file exists, delete it + if(is_file($this->sFile)) + unlink($this->sFile); } diff --git a/include/screenshot.php b/include/screenshot.php index dbe3657..9a33433 100644 --- a/include/screenshot.php +++ b/include/screenshot.php @@ -139,7 +139,12 @@ class Screenshot { $this->oScreenshotImage->delete(); $this->oThumbnailImage->delete(); - unlink(appdb_fullpath("/data/screenshots/originals/".$this->iScreenshotId)); + + // if the original file exists, delete it + $sOriginalFilename = appdb_fullpath("/data/screenshots/originals/".$this->iScreenshotId); + if(is_file($sOriginalFilename)) + unlink($sOriginalFilename); + if(!$bSilent) $this->mailMaintainers(true); }