diff --git a/meta/lib/oe/license_finder.py b/meta/lib/oe/license_finder.py
index d08d4af5d2..cd290adf59 100644
--- a/meta/lib/oe/license_finder.py
+++ b/meta/lib/oe/license_finder.py
@@ -55,7 +55,8 @@ def _crunch_known_licenses(d):
             md5sums[md5value] = fn
             # Also hash a "crunched" version
             md5value = _crunch_license(path)
-            md5sums[md5value] = fn
+            if md5value:
+                md5sums[md5value] = fn
 
     return md5sums
 
@@ -115,6 +116,11 @@ def _crunch_license(licfile):
             if line:
                 lictext.append(line)
 
+    # Only titles, copyright lines or URLs: there is no license text to
+    # compare, and an empty text would match every other empty text
+    if not lictext:
+        return None
+
     m = hashlib.md5()
     try:
         m.update(' '.join(lictext).encode('utf-8'))
