aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/lib/metadata.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php
index 17835e07e..e867311ae 100644
--- a/engine/lib/metadata.php
+++ b/engine/lib/metadata.php
@@ -977,10 +977,12 @@ function clear_metadata_by_owner($owner_guid) {
$metas = get_data("SELECT id from {$CONFIG->dbprefix}metadata WHERE owner_guid=$owner_guid");
$deleted = 0;
- foreach ($metas as $id) {
- // Is this the best way?
- if (delete_metadata($id->id)) {
- $deleted++;
+ if (is_array($metas)) {
+ foreach ($metas as $id) {
+ // Is this the best way?
+ if (delete_metadata($id->id)) {
+ $deleted++;
+ }
}
}