diff --git a/lib/database/domain.js b/lib/database/domain.js
index <HASH>..<HASH> 100644
--- a/lib/database/domain.js
+++ b/lib/database/domain.js
@@ -71,9 +71,11 @@ Domain.prototype = {
         return domainNameFromHost;
     }
 
-    var domainNameFromPath = Domain.getNameFromPath(source.url);
-    if (domainNameFromPath)
-      return domainNameFromPath;
+    if (source.url) {
+      var domainNameFromPath = Domain.getNameFromPath(source.url);
+      if (domainNameFromPath)
+        return domainNameFromPath;
+    }
 
     throw new Error('no domain name');
   },
Fix error around undefined (or null) request.url