Skip to content

Commit e69ba8d

Browse files
committed
This also avoids accessing "path" on a null source when sourceInfo() returns null.
1 parent ae60b9a commit e69ba8d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

phpdotnet/phd/Package/PHP/Web.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,13 @@ public function header($id) {
205205
"source" => $this->sourceInfo($id),
206206
);
207207
$history = $this->history ?? [];
208-
$setup["history"] = $history[$setup["source"]["path"]] ?? [];
208+
209+
$sourcePath = $setup["source"]["path"] ?? null;
210+
211+
$setup["history"] = $sourcePath !== null
212+
? ($history[$sourcePath] ?? [])
213+
: [];
214+
209215
if ($this->getChildren($id)) {
210216
$lang = $this->config->language;
211217
$setup["extra_header_links"] = array(

0 commit comments

Comments
 (0)