summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/tag/helpers/tag.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/tag/helpers/tag.php b/modules/tag/helpers/tag.php
index 3c35a191..cedf307e 100644
--- a/modules/tag/helpers/tag.php
+++ b/modules/tag/helpers/tag.php
@@ -29,6 +29,10 @@ class tag_Core {
* @throws Exception("@todo {$tag_name} WAS_NOT_ADDED_TO {$item->id}")
*/
static function add($item, $tag_name) {
+ if (empty($tag_name)) {
+ throw new exception("@todo MISSING_TAG_NAME");
+ }
+
$tag = ORM::factory("tag")->where("name", $tag_name)->find();
if (!$tag->loaded) {
$tag->name = $tag_name;