Skip to content

Commit 5c506bc

Browse files
committed
php warning fixed
1 parent 5320895 commit 5c506bc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/Service/Structure/ContentTypeService.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,11 @@ private function checkForArticleRedirect(string $path): ?ContentType
8686
return null;
8787
}
8888
$redirections = rex_yrewrite::$paths['redirections'];
89-
foreach ($redirections['default'] as $idx => $redirection) {
90-
if (ltrim($redirection[1]['path'], '/') == $path) {
91-
return new ContentType('article_redirect', rex_clang::getCurrentId(), new ID($idx));
89+
if (isset($redirections['default'])) {
90+
foreach ($redirections['default'] as $idx => $redirection) {
91+
if (ltrim($redirection[1]['path'], '/') == $path) {
92+
return new ContentType('article_redirect', rex_clang::getCurrentId(), new ID($idx));
93+
}
9294
}
9395
}
9496
return null;

0 commit comments

Comments
 (0)