From 77883aef4bb8531c83bdeac45a5463a76e1158d7 Mon Sep 17 00:00:00 2001 From: thickbrick Date: Sun, 16 Jan 2011 02:03:16 +0200 Subject: Fix #756: Link button in build floater can crash Prevent null dereference when the selection has no primary object, e.g. rubber band selection. --- linden/indra/newview/llfloatertools.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linden/indra/newview/llfloatertools.cpp b/linden/indra/newview/llfloatertools.cpp index 683ebd4..cc205ee 100644 --- a/linden/indra/newview/llfloatertools.cpp +++ b/linden/indra/newview/llfloatertools.cpp @@ -1256,7 +1256,8 @@ void LLFloaterTools::onClickLink(void* data) } S32 max_linked_prims = 0; - if(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()->usePhysics()) + LLViewerObject* first_rootp = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject(); + if(first_rootp && first_rootp->usePhysics()) { //Physical - use phys prim limit max_linked_prims = gHippoLimits->getMaxPhysLinkedPrims(); -- cgit v1.1