From 553500a3447667aaa9bd3b922742575562c03b68 Mon Sep 17 00:00:00 2001 From: tanaga9 Date: Sun, 27 Oct 2019 01:49:59 +0900 Subject: Check if submodule exists before referencing --- git/diff.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/git/diff.py b/git/diff.py index a0076f0c..fcf40f2b 100644 --- a/git/diff.py +++ b/git/diff.py @@ -283,7 +283,8 @@ class Diff(object): if repo and a_rawpath: for submodule in repo.submodules: if submodule.path == a_rawpath.decode("utf-8"): - repo = submodule.module() + if submodule.module_exists(): + repo = submodule.module() break if a_blob_id is None or a_blob_id == self.NULL_HEX_SHA: -- cgit v1.2.1