fix: crash when leaving out system parameter
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>
This commit is contained in:
@@ -143,11 +143,13 @@ class BoardImportService {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $system
|
||||
* @param ?string $system
|
||||
* @return self
|
||||
*/
|
||||
public function setSystem($system): self {
|
||||
$this->system = $system;
|
||||
if ($system) {
|
||||
$this->system = $system;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user