summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2010-12-29 13:07:13 -0500
committerLoren Shih <seraph@lindenlab.com>2010-12-29 13:07:13 -0500
commit3c91317a2b382ecd62b6581eb5e0c2476f29ced3 (patch)
tree422a2007092944a517d5a082d1483039b969e489
parenta86e35aa0dbd8d2acd4d4e9d83e8919bcc44a0b1 (diff)
SH-652 Viewer crash when right-clicking an avatar while in edit mode
Null pointer issue.
-rw-r--r--indra/newview/llvovolume.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index fa0f48fce6..3219f662df 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -2905,12 +2905,21 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
{
// base cost of each prim should be 10 points
static const U32 ARC_PRIM_COST = 10;
-
- // get access to params we'll need at various points
- LLVolumeParams volume_params = getVolume()->getParams();
- LLPathParams path_params = volume_params.getPathParams();
- LLProfileParams profile_params = volume_params.getProfileParams();
+ // Get access to params we'll need at various points.
+ // Skip if this is object doesn't have a volume (e.g. is an avatar).
+ const BOOL has_volume = (getVolume() != NULL);
+ LLVolumeParams volume_params;
+ LLPathParams path_params;
+ LLProfileParams profile_params;
+
+ if (has_volume)
+ {
+ volume_params = getVolume()->getParams();
+ path_params = volume_params.getPathParams();
+ profile_params = volume_params.getProfileParams();
+ }
+
// per-prim costs
static const U32 ARC_INVISI_COST = 1;
static const U32 ARC_PARTICLE_COST = 100;