summaryrefslogtreecommitdiff
path: root/inc/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/functions.php')
-rwxr-xr-xinc/functions.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/inc/functions.php b/inc/functions.php
index c50336ae..c46807bb 100755
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -1130,6 +1130,8 @@ function deleteFile($id, $remove_entirely_if_already=true, $file=null) {
$files = json_decode($post['files']);
$file_to_delete = $file !== false ? $files[(int)$file] : (object)array('file' => false);
+ if (!$files[0]) error(_('That post has no files.'));
+
if ($files[0]->file == 'deleted' && $post['num_files'] == 1 && !$post['thread'])
return; // Can't delete OP's image completely.