3235: Add test case.
[arvados.git] / services / api / lib / has_uuid.rb
index 3bd330edca59808bd3fbbe21f49725c687e5e7c7..481d27a037ed4036561bf499e2ae94af6c71011d 100644 (file)
@@ -36,7 +36,9 @@ module HasUuid
   end
 
   def destroy_permission_links
-    Link.destroy_all(['link_class=? and (head_uuid=? or tail_uuid=?)',
-                      'permission', uuid, uuid])
+    if uuid
+      Link.destroy_all(['link_class=? and (head_uuid=? or tail_uuid=?)',
+                        'permission', uuid, uuid])
+    end
   end
 end