From 169764fc51693b767490f20a6c4541524ab09cc8 Mon Sep 17 00:00:00 2001 From: Richard Stanway Date: Thu, 18 Jun 2020 23:43:52 +0200 Subject: [PATCH] UI: Don't try to load replay buffer hotkey if null If replay buffer hotkey isn't set, this would cause an error to be logged due to a null string. --- UI/window-basic-main-outputs.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/UI/window-basic-main-outputs.cpp b/UI/window-basic-main-outputs.cpp index 8e0265f4e..0bf0fb919 100644 --- a/UI/window-basic-main-outputs.cpp +++ b/UI/window-basic-main-outputs.cpp @@ -367,9 +367,14 @@ SimpleOutput::SimpleOutput(OBSBasic *main_) : BasicOutputHandler(main_) bool useReplayBuffer = config_get_bool(main->Config(), "SimpleOutput", "RecRB"); if (useReplayBuffer) { + obs_data_t *hotkey; const char *str = config_get_string( main->Config(), "Hotkeys", "ReplayBuffer"); - obs_data_t *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);