Skip to content

Commit 553500a

Browse files
tanaga9Byron
authored andcommitted
Check if submodule exists before referencing
1 parent ebf4656 commit 553500a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

git/diff.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,8 @@ def __init__(self, repo, a_rawpath, b_rawpath, a_blob_id, b_blob_id, a_mode,
283283
if repo and a_rawpath:
284284
for submodule in repo.submodules:
285285
if submodule.path == a_rawpath.decode("utf-8"):
286-
repo = submodule.module()
286+
if submodule.module_exists():
287+
repo = submodule.module()
287288
break
288289

289290
if a_blob_id is None or a_blob_id == self.NULL_HEX_SHA:

0 commit comments

Comments
 (0)