mirror of
https://github.com/wiiu-env/WiiUPluginLoaderBackend.git
synced 2025-02-02 05:52:36 +01:00
ButtonComboAPI: Check if provided callback is null
This commit is contained in:
parent
a10fe0fb1f
commit
389b9fc9f1
@ -340,6 +340,11 @@ namespace {
|
|||||||
class ButtonComboWrapper {
|
class ButtonComboWrapper {
|
||||||
public:
|
public:
|
||||||
static std::optional<ButtonComboWrapper> Create(const WUPSButtonCombo_ComboOptions &otherOptions, WUPSButtonCombo_ComboStatus &outStatus, WUPSButtonCombo_Error &outError) {
|
static std::optional<ButtonComboWrapper> Create(const WUPSButtonCombo_ComboOptions &otherOptions, WUPSButtonCombo_ComboStatus &outStatus, WUPSButtonCombo_Error &outError) {
|
||||||
|
if (otherOptions.callbackOptions.callback == nullptr) {
|
||||||
|
outStatus = WUPS_BUTTON_COMBO_COMBO_STATUS_INVALID_STATUS;
|
||||||
|
outError = WUPS_BUTTON_COMBO_ERROR_INVALID_ARGS;
|
||||||
|
return {};
|
||||||
|
}
|
||||||
ButtonComboModule_ComboStatus status = BUTTON_COMBO_MODULE_COMBO_STATUS_INVALID_STATUS;
|
ButtonComboModule_ComboStatus status = BUTTON_COMBO_MODULE_COMBO_STATUS_INVALID_STATUS;
|
||||||
auto contextData = std::make_unique<ComboCallbackWrapperData>(otherOptions.callbackOptions.callback, otherOptions.callbackOptions.context);
|
auto contextData = std::make_unique<ComboCallbackWrapperData>(otherOptions.callbackOptions.callback, otherOptions.callbackOptions.context);
|
||||||
ButtonComboModule_ComboOptions convertedOptions;
|
ButtonComboModule_ComboOptions convertedOptions;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user