From 3c91317a2b382ecd62b6581eb5e0c2476f29ced3 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 29 Dec 2010 13:07:13 -0500 Subject: SH-652 Viewer crash when right-clicking an avatar while in edit mode Null pointer issue. --- indra/newview/llvovolume.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'indra') 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; -- cgit v1.2.3