Skip to content

Commit 96e63a4

Browse files
committed
fix(backend): handle undefined array key name
1 parent 5d427ae commit 96e63a4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

modules/core/hm-mailbox.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,18 @@ public function get_folder_name($folder) {
130130
$this->connect();
131131
}
132132
$result = $this->connection->get_folder_status($folder);
133+
134+
// Proper error handling instead of masking
135+
if (empty($result)) {
136+
error_log("Folder not found: " . $folder . " on server " . $this->server_id);
137+
return false;
138+
}
139+
140+
if (!isset($result['name'])) {
141+
error_log("Folder status missing name field: " . print_r($result, true));
142+
return $folder;
143+
}
144+
133145
return $result['name'];
134146
}
135147
}

0 commit comments

Comments
 (0)