Skip to content

Commit

Permalink
fix: index 0 of length 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Darker935 authored Jun 16, 2024
1 parent 965213a commit c614bea
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c614bea

Please sign in to comment.