From 5bdec62cb0a003375a510f8c16879ef47d0c3bf2 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Sun, 30 Jun 2024 22:33:59 +0200 Subject: [PATCH] Issue #2541 - Deal with empty LineNameList in CSS grid templates. Resolves #2541 --- layout/style/nsComputedDOMStyle.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp index 68cbdbea2e..7794d6af8e 100644 --- a/layout/style/nsComputedDOMStyle.cpp +++ b/layout/style/nsComputedDOMStyle.cpp @@ -2799,8 +2799,10 @@ nsComputedDOMStyle::GetGridTemplateColumnsRows( AppendGridLineNames(valueList, lineNames); } } else { - const nsTArray& lineNames = aTrackList.mLineNameLists[i]; - AppendGridLineNames(valueList, lineNames); + if (aTrackList.mLineNameLists.Length() > 0) { + const nsTArray& lineNames = aTrackList.mLineNameLists[i]; + AppendGridLineNames(valueList, lineNames); + } } if (uint32_t(i) == numExplicitTracks) { break;