Skip to content

Commit

Permalink
fix: fix for update_project: ensure that there is no key error
Browse files Browse the repository at this point in the history
  • Loading branch information
t-graf committed Mar 8, 2024
1 parent ee164bb commit 543fce2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

# SW360 Base Library for Python

## V1.4.1

* fix for `update_project`: ensure that there is no key error.

## V1.4.0

* have type hints.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[tool.poetry]
name = "sw360"
version = "1.4.0"
version = "1.4.1"
description = "Python interface to the SW360 software component catalogue"
authors = ["Thomas Graf <thomas.graf@siemens.com>",
"Gernot Hillier <gernot.hillier@siemens.com>"]
Expand Down
4 changes: 2 additions & 2 deletions sw360/project.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -------------------------------------------------------------------------------
# Copyright (c) 2019-2023 Siemens
# Copyright (c) 2019-2024 Siemens
# Copyright (c) 2022 BMW CarIT GmbH
# All Rights Reserved.
# Authors: thomas.graf@siemens.com, gernot.hillier@siemens.com
Expand Down Expand Up @@ -337,7 +337,7 @@ def update_project(self, project: Dict[str, Any], project_id: str,

if add_subprojects:
current = self.get_project(project_id)
if (current is not None and "linkedProjects" in current):
if (current is not None and "linkedProjects" in current and "linkedProjects" in project):
for sp in current["linkedProjects"]:
pid = self.get_id_from_href(sp["project"])
if pid not in project["linkedProjects"]:
Expand Down

0 comments on commit 543fce2

Please sign in to comment.