Skip to content

Commit

Permalink
Fixed error message after removing and re-uploading image.
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Melab committed Jul 24, 2012
1 parent 2fabfc6 commit 714f367
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion noticeme.field.inc
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ function noticeme_field_update($entity_type, $entity, $field, $instance, $langco
$original_fids[] = $original_item['image'];
if (isset($original_item['image']) && !in_array($original_item['image'], $current_fids)) {
// Decrement the file usage count by 1 and delete the file if possible.
file_field_delete_file((array)file_load($original_item['image']), $field, $entity_type, $id);
if ($file = file_load($original_item['image'])) {
file_field_delete_file((array) $file, $field, $entity_type, $id);
}
}
}
}
Expand Down

0 comments on commit 714f367

Please sign in to comment.