diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index 12ca1ac71b167601b47eac481614176216803d67..3a481819a5ee51d9ca311c120a8ee385857f9348 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -1293,7 +1293,7 @@ void LLButton::setFloaterToggle(LLUICtrl* ctrl, const LLSD& sdname)
 	// Set the button control value (toggle state) to the floater visibility control (Sets the value as well)
 	button->setControlVariable(LLFloater::getControlGroup()->getControl(vis_control_name));
 	// Set the clicked callback to toggle the floater
-	button->setClickedCallback([](LLUICtrl* ctrl, const LLSD& param) -> void { LLFloaterReg::toggleInstance(param.asStringRef(), LLSD()); });
+	button->setClickedCallback([=](LLUICtrl* ctrl, const LLSD& param) -> void { LLFloaterReg::toggleInstance(sdname.asStringRef(), LLSD()); });
 }
 
 // static