don't try to save empty tags

This commit is contained in:
James Walker 2010-07-28 11:57:54 -04:00
parent 4853b1e2a0
commit 29b8a6a18f

View File

@ -329,14 +329,16 @@ class Status_network extends Safe_DataObject
{ {
$this->clearTags(); $this->clearTags();
foreach ($tags as $tag) { foreach ($tags as $tag) {
$snt = new Status_network_tag(); if (!empty($tag)) {
$snt->site_id = $this->site_id; $snt = new Status_network_tag();
$snt->tag = $tag; $snt->site_id = $this->site_id;
$snt->created = common_sql_now(); $snt->tag = $tag;
$snt->created = common_sql_now();
$id = $snt->insert();
if (!$id) { $id = $snt->insert();
throw new Exception(_("Unable to save tag.")); if (!$id) {
throw new Exception(_("Unable to save tag."));
}
} }
} }