fix errors when getting text without update-type

This commit is contained in:
Franzi 2021-12-05 16:46:34 +01:00
parent 04dc93e951
commit 1775b16fde
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -173,7 +173,8 @@ void handleWebSocketEvent(WStype_t type, uint8_t * payload, size_t length) {
is_currently_preview = false;
}
}
} else if (strcmp(doc["update-type"], "Exiting") == 0) {
} else if (doc.containsKey("update-type")) {
if (strcmp(doc["update-type"], "Exiting") == 0) {
Serial.println("[OBS] quit");
is_currently_preview = false;
is_currently_live = false;
@ -181,6 +182,7 @@ void handleWebSocketEvent(WStype_t type, uint8_t * payload, size_t length) {
Serial.println("[OBS] studio mode disabled");
is_currently_preview = false;
}
}
if (is_currently_live) {
set_program();