From c614bea0081e20a3cc89cef8389e3cd0a89b9a9b Mon Sep 17 00:00:00 2001 From: Quishot WADEV <70950705+Darker935@users.noreply.github.com> Date: Sun, 16 Jun 2024 19:47:39 -0300 Subject: [PATCH] fix: index 0 of length 0 --- .../it/auties/whatsapp/model/message/model/ChatMessageKey.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/it/auties/whatsapp/model/message/model/ChatMessageKey.java b/src/main/java/it/auties/whatsapp/model/message/model/ChatMessageKey.java index 18c46724..d00cf567 100644 --- a/src/main/java/it/auties/whatsapp/model/message/model/ChatMessageKey.java +++ b/src/main/java/it/auties/whatsapp/model/message/model/ChatMessageKey.java @@ -69,7 +69,7 @@ public static String randomId() { */ public static String randomIdV2(Jid jid, ClientType... clientType) { - var type = Objects.requireNonNullElse(clientType[0], ClientType.WEB); + var type = clientType.length == 0 ? ClientType.WEB : clientType[0]; return switch (type) { case ClientType.WEB -> randomWebKeyId(jid); case ClientType.MOBILE -> randomMobileKeyId(jid);