diff options
author | Simon Rettberg | 2024-02-15 12:23:44 +0100 |
---|---|---|
committer | Simon Rettberg | 2024-02-15 12:23:44 +0100 |
commit | e6c16aa7e5a7ed1d0bb3f9dd810e57505fa74c31 (patch) | |
tree | fba332992e4bab01959813313f19cc69d4a5f0f6 /modules-available/dnbd3/inc | |
parent | [roomplanner] Fix passed type to runmode (diff) | |
download | slx-admin-e6c16aa7e5a7ed1d0bb3f9dd810e57505fa74c31.tar.gz slx-admin-e6c16aa7e5a7ed1d0bb3f9dd810e57505fa74c31.tar.xz slx-admin-e6c16aa7e5a7ed1d0bb3f9dd810e57505fa74c31.zip |
[dnbd3] Fix type error
Uncaught TypeError: Dnbd3Util::runmodeConfigHook(): Argument #3 ($modeData) must be of type string, null given
Diffstat (limited to 'modules-available/dnbd3/inc')
-rw-r--r-- | modules-available/dnbd3/inc/dnbd3util.inc.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules-available/dnbd3/inc/dnbd3util.inc.php b/modules-available/dnbd3/inc/dnbd3util.inc.php index 7d95147a..314c44fe 100644 --- a/modules-available/dnbd3/inc/dnbd3util.inc.php +++ b/modules-available/dnbd3/inc/dnbd3util.inc.php @@ -110,7 +110,7 @@ class Dnbd3Util { * * @param string $mode always 'proxy' */ - public static function runmodeConfigHook(string $machineUuid, string $mode, string $modeData) + public static function runmodeConfigHook(string $machineUuid, string $mode, ?string $modeData) { $self = Property::getServerIp(); // Get all directly assigned locations @@ -122,7 +122,7 @@ class Dnbd3Util { foreach ($res as $row) { $assignedLocs[] = $row['locationid']; } - $modeData = (array)json_decode($modeData, true) + self::defaultRunmodeConfig(); + $modeData = (array)json_decode($modeData ?? '{}', true) + self::defaultRunmodeConfig(); if (!empty($assignedLocs) && ($modeData['firewall'] ?? false)) { // Get all sub-locations too $recursiveLocs = $assignedLocs; |