diff --git a/src/r_data/r_sections.h b/src/r_data/r_sections.h index fcd7cd3b2..221d19e63 100644 --- a/src/r_data/r_sections.h +++ b/src/r_data/r_sections.h @@ -141,6 +141,7 @@ public: } TArrayView SectionsForSector(int sindex) { + if (numberOfSectionForSectorPtr[sindex] == 0) return TArrayView(nullptr); return sindex < 0 ? TArrayView(0) : TArrayView(&allSections[firstSectionForSectorPtr[sindex]], numberOfSectionForSectorPtr[sindex]); } int SectionIndex(const FSection *sect)