Permalink
Browse files

Short circuit on delete annotations to avoid error message

git-svn-id: https://code.elgg.org/elgg/trunk@3373 36083f99-b078-4883-b0ff-0f9b5a30f544
  • Loading branch information...
1 parent e743955 commit ec1fdfb796f5e0442cd5ce11eb8b1cb52c6d8b6d marcus committed Jul 1, 2009
Showing with 3 additions and 0 deletions.
  1. +3 −0 engine/lib/annotations.php
@@ -851,6 +851,9 @@ function clear_annotations_by_owner($owner_guid)
$annotations = get_data("SELECT id from {$CONFIG->dbprefix}annotations WHERE owner_guid=$owner_guid");
$deleted = 0;
+ if (!$annotations)
+ return 0;
+
foreach ($annotations as $id)
{
if (delete_annotation($id->id)) // Is this the best way?

0 comments on commit ec1fdfb

Please sign in to comment.