maven: Fix argument of type 'NoneType' is not iterable

Related to T3874
This commit is contained in:
Antoine R. Dumont (@ardumont) 2022-04-14 15:33:24 +02:00
parent 7c8428d01c
commit 10bb8db345
No known key found for this signature in database
GPG key ID: 52E2E9840D10C3B8

View file

@ -261,11 +261,14 @@ class MavenLister(Lister[MavenListerState, RepoPage]):
try:
response = self.page_request(pom, {})
project = xmltodict.parse(response.content.decode())
if "scm" in project["project"]:
if "connection" in project["project"]["scm"]:
scm = project["project"]["scm"]["connection"]
gid = project["project"]["groupId"]
aid = project["project"]["artifactId"]
project_d = project.get("project", {})
scm_d = project_d.get("scm")
if scm_d is not None:
connection = scm_d.get("connection")
if connection is not None:
scm = connection
gid = project_d["groupId"]
aid = project_d["artifactId"]
artifact_metadata_d = {
"type": "scm",
"doc": out_pom[pom],