diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index 85ae13a889694d249162679cc5fc8be9a7b9a191..30fc7babaef355e687e7b20c7ab89f98d7663772 100644
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -1649,7 +1649,7 @@ void LLTabContainer::reshapeTuple(LLTabTuple* tuple)
 		if(mCustomIconCtrlUsed)
 		{
 			LLCustomButtonIconCtrl* button = dynamic_cast<LLCustomButtonIconCtrl*>(tuple->mButton);
-			LLIconCtrl* icon_ctrl = button->getIconCtrl();
+			LLIconCtrl* icon_ctrl = button ? button->getIconCtrl() : NULL;
 			image_overlay_width = icon_ctrl ? icon_ctrl->getRect().getWidth() : 0;
 		}
 		else