From 08cf926d3b6eb28e0b9751ba62b1ce01230a150b Mon Sep 17 00:00:00 2001
From: Andrey Kleshchev <andreykproductengine@lindenlab.com>
Date: Fri, 26 Jan 2024 02:27:35 +0200
Subject: Issue #17 Crash at autoAdjustOrigin

---
 indra/newview/llreflectionmap.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llreflectionmap.cpp b/indra/newview/llreflectionmap.cpp
index a26445b4bc..2e5aaa997d 100644
--- a/indra/newview/llreflectionmap.cpp
+++ b/indra/newview/llreflectionmap.cpp
@@ -74,8 +74,9 @@ void LLReflectionMap::autoAdjustOrigin()
     {
         const LLVector4a* bounds = mGroup->getBounds();
         auto* node = mGroup->getOctreeNode();
+        LLSpatialPartition* part = mGroup->getSpatialPartition();
 
-        if (mGroup->getSpatialPartition()->mPartitionType == LLViewerRegion::PARTITION_VOLUME)
+        if (part && part->mPartitionType == LLViewerRegion::PARTITION_VOLUME)
         {
             mPriority = 0;
             // cast a ray towards 8 corners of bounding box
-- 
cgit v1.2.3