From 01dab6aa304a5b7ad7ceb939e7348da6fc8b4043 Mon Sep 17 00:00:00 2001 From: fgerber Date: Mon, 8 Apr 2024 10:52:08 +0200 Subject: [PATCH] Prevent overriding default group --- app/src/main/java/net/helcel/beans/helper/Groups.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/net/helcel/beans/helper/Groups.kt b/app/src/main/java/net/helcel/beans/helper/Groups.kt index 2e2cc1d..84f972f 100644 --- a/app/src/main/java/net/helcel/beans/helper/Groups.kt +++ b/app/src/main/java/net/helcel/beans/helper/Groups.kt @@ -34,7 +34,7 @@ class Groups(val id: Int, private val grps: HashMap) { fun genKey(): Int { val key = rnd.nextInt() - if (grps.containsKey(key) || key in listOf(NO_GROUP, AUTO_GROUP)) return genKey() + if (grps.containsKey(key) || key in listOf(NO_GROUP, DEFAULT_GROUP, AUTO_GROUP)) return genKey() return key }