summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatermodelpreview.cpp
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2011-06-17 09:59:37 -0600
committerXiaohong Bao <bao@lindenlab.com>2011-06-17 09:59:37 -0600
commitfe022adfa637d4f4f08d48576c75b5148573c8ed (patch)
tree1237b89edfdbfb808f1f3052aee9ede8d1ddc36f /indra/newview/llfloatermodelpreview.cpp
parent47b9f588df1f90126aa630ed050e41b2d145a085 (diff)
fix for SH-1783: [PUBLIC] Crash when adding a physics shape.
Diffstat (limited to 'indra/newview/llfloatermodelpreview.cpp')
-rw-r--r--indra/newview/llfloatermodelpreview.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index ab6753b4be..75728fdeeb 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -3107,18 +3107,20 @@ void LLModelPreview::rebuildUploadData()
}
}
- for (U32 i = 0; i < LLModel::NUM_LODS; i++)
- { //fill LOD slots based on reference model index
- if (!mModel[i].empty())
- {
- instance.mLOD[i] = mModel[i][idx];
- }
- else
- {
- instance.mLOD[i] = NULL;
+ if(idx < mBaseModel.size())
+ {
+ for (U32 i = 0; i < LLModel::NUM_LODS; i++)
+ { //fill LOD slots based on reference model index
+ if (mModel[i].size() > idx)
+ {
+ instance.mLOD[i] = mModel[i][idx];
+ }
+ else
+ {
+ instance.mLOD[i] = NULL;
+ }
}
}
-
instance.mTransform = mat;
mUploadData.push_back(instance);
}