Signed-off-by: Perry Hargrave <[email protected]>
---
 lib/awful/tag.lua.in |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/lib/awful/tag.lua.in b/lib/awful/tag.lua.in
index 16bd54b..3563c26 100644
--- a/lib/awful/tag.lua.in
+++ b/lib/awful/tag.lua.in
@@ -33,8 +33,14 @@ history.limit = 20
 --- Add a tag.
 -- @param name The tag name, a string
 -- @param props The tags properties, a table
--- @return The created tag
+-- @return The created tag or nil if not created.
+-- If the name is a valid string then the tag will be created and each 
key,value
+-- pair in 'props' table is iterated and applied to the tag. If the 'name'
+-- argument is nil or its string length is zero then the function returns nil.
 function add(name, props)
+    -- abort if the name is not provided
+    if not name or #(tostring(name)) == 0 then return end
+
     local properties = props or {}
     local newtag = capi.tag{name = name}
     newtag.screen = properties.screen or capi.mouse.screen
-- 
1.7.1


-- 
To unsubscribe, send mail to [email protected].

Reply via email to