|
@@ -297,7 +297,14 @@ std::shared_ptr<CToggleButton> InterfaceObjectConfigurable::buildToggleButton(co
|
|
|
button->setImageOrder(imgOrder[0].Integer(), imgOrder[1].Integer(), imgOrder[2].Integer(), imgOrder[3].Integer());
|
|
|
}
|
|
|
if(!config["callback"].isNull())
|
|
|
- button->addCallback(callbacks.at(config["callback"].String()));
|
|
|
+ {
|
|
|
+ std::string callbackName = config["callback"].String();
|
|
|
+
|
|
|
+ if (callbacks.count(callbackName))
|
|
|
+ button->addCallback(callbacks.at(callbackName));
|
|
|
+ else
|
|
|
+ logGlobal->error("Invalid callback '%s' in widget", callbackName );
|
|
|
+ }
|
|
|
return button;
|
|
|
}
|
|
|
|