From ff42da373bf5e93f938057476af919a60056bcc3 Mon Sep 17 00:00:00 2001 From: Matt Gajownik Date: Sat, 8 Jan 2022 13:34:40 +1100 Subject: [PATCH] UI: Fix hotkey JSON error for Advanced Replay Buffer This matches the Simple output Replay Buffer hotkey code. --- UI/window-basic-main-outputs.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/UI/window-basic-main-outputs.cpp b/UI/window-basic-main-outputs.cpp index 989a19055..d4351f7f6 100644 --- a/UI/window-basic-main-outputs.cpp +++ b/UI/window-basic-main-outputs.cpp @@ -1205,10 +1205,14 @@ AdvancedOutput::AdvancedOutput(OBSBasic *main_) : BasicOutputHandler(main_) bool useReplayBuffer = config_get_bool(main->Config(), "AdvOut", "RecRB"); if (useReplayBuffer) { + OBSDataAutoRelease hotkey; const char *str = config_get_string( main->Config(), "Hotkeys", "ReplayBuffer"); - OBSDataAutoRelease hotkey = - obs_data_create_from_json(str); + if (str) + hotkey = obs_data_create_from_json(str); + else + hotkey = nullptr; + replayBuffer = obs_output_create("replay_buffer", Str("ReplayBuffer"), nullptr, hotkey);