Skip to content

Commit 1458af3

Browse files
committed
fix: do not trigger Undefined array key "x"
1 parent 4fc82f4 commit 1458af3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PhpSpreadsheet/Reader/Xml/Style.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function parseStyles(SimpleXMLElement $xml, array $namespaces): array
7676
break;
7777
case 'Protection':
7878
$locked = $hidden = null;
79-
$styleAttributesP = $styleData->attributes($namespaces['x']);
79+
$styleAttributesP = array_key_exists('x', $namespaces) ? $styleData->attributes($namespaces['x']) : [];
8080
if (isset($styleAttributes['Protected'])) {
8181
$locked = ((bool) (string) $styleAttributes['Protected']) ? Protection::PROTECTION_PROTECTED : Protection::PROTECTION_UNPROTECTED;
8282
}

0 commit comments

Comments
 (0)