Fix isDesiredNameMessage not working for undefined desiredName

This commit is contained in:
Tobias Berger 2022-02-07 15:21:26 +01:00
parent efc59f871b
commit 221ed4fcc3

View file

@ -186,7 +186,7 @@ export function isDesiredNameMessage(obj: unknown): obj is DesiredNameMessage {
return false;
}
if (
!Object.hasOwnProperty.call(obj, "desiredName") ||
Object.hasOwnProperty.call(obj, "desiredName") &&
typeof (obj as ServerMessage & { desiredName: unknown }).desiredName !==
"string"
) {