From 29b8a6a18f67de74fb6adb9e91c10e7d1577c067 Mon Sep 17 00:00:00 2001 From: James Walker Date: Wed, 28 Jul 2010 11:57:54 -0400 Subject: [PATCH] don't try to save empty tags --- classes/Status_network.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/classes/Status_network.php b/classes/Status_network.php index d1ca454e22..339f4c813b 100644 --- a/classes/Status_network.php +++ b/classes/Status_network.php @@ -329,14 +329,16 @@ class Status_network extends Safe_DataObject { $this->clearTags(); foreach ($tags as $tag) { - $snt = new Status_network_tag(); - $snt->site_id = $this->site_id; - $snt->tag = $tag; - $snt->created = common_sql_now(); - - $id = $snt->insert(); - if (!$id) { - throw new Exception(_("Unable to save tag.")); + if (!empty($tag)) { + $snt = new Status_network_tag(); + $snt->site_id = $this->site_id; + $snt->tag = $tag; + $snt->created = common_sql_now(); + + $id = $snt->insert(); + if (!$id) { + throw new Exception(_("Unable to save tag.")); + } } } -- 2.39.5