--- nodewords.module.old	2006-01-31 20:51:58.000000000 -0500
+++ nodewords.module	2006-01-31 20:53:19.000000000 -0500
@@ -269,12 +269,14 @@
 
 /* Update or insert tags in the table */
 function _nodewords_set($type, $id, $tags) {
-  foreach ($tags as $name => $content) {
-    if (empty($content)) {
-      _nodewords_delete_tag($type, $id, $name);
-    }
-    else {
-      _nodewords_update_tag($type, $id, $name, $content);
+  if (!empty($tags) && is_array($tags)) {
+    foreach ($tags as $name => $content) {
+      if (empty($content)) {
+        _nodewords_delete_tag($type, $id, $name);
+      }
+      else {
+        _nodewords_update_tag($type, $id, $name, $content);
+      }
     }
   }
 }
