Skip to content

Commit

Permalink
fix: crash when leaving out system parameter
Browse files Browse the repository at this point in the history
The `--system` parameter can be supplied via command line
or selected afterwards.

However if none was provided the command would crash with
`TypeError: Cannot assign null to property $system`.

Handle that gracefully and make the type spec more precise
for the setSystem function.

Signed-off-by: Max <max@nextcloud.com>
  • Loading branch information
max-nextcloud authored and backportbot-nextcloud[bot] committed Jun 20, 2023
1 parent 5cf3f48 commit 0456e43
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Service/Importer/BoardImportService.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,13 @@ public function validateSystem(): void {
}

/**
* @param mixed $system
* @param ?string $system
* @return self
*/
public function setSystem($system): self {
$this->system = $system;
if ($system) {
$this->system = $system;
}
return $this;
}

Expand Down

0 comments on commit 0456e43

Please sign in to comment.