diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index 4d709ed8c..46b2bff01 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -140,6 +140,9 @@ def checkout_layers(layers, confdir, layerdir, d):
 
     def _has_local_modifications(r_name, r_path):
         fixed_revisions = json.load(open(os.path.join(confdir, "sources-fixed-revisions.json")))
+
+        if not r_name in fixed_revisions['sources']:
+            return False
         rev = fixed_revisions['sources'][r_name]['git-remote']['rev']
         status = bb.process.run('git -C {} status --porcelain'.format(r_path))[0]
         if status:
