浏览代码

UI: Fix hotkey JSON error for Advanced Replay Buffer

This matches the Simple output Replay Buffer hotkey code.
Matt Gajownik 3 年之前
父节点
当前提交
ff42da373b
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      UI/window-basic-main-outputs.cpp

+ 6 - 2
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);