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;