forked from SteamWar/SteamWar
Hotfix: Groups
This commit is contained in:
@@ -37,6 +37,9 @@ class Groups {
|
|||||||
private var groups: GroupsData = if (kGroupsFile.exists()) {
|
private var groups: GroupsData = if (kGroupsFile.exists()) {
|
||||||
Cbor.decodeFromByteArray(kGroupsFile.readBytes())
|
Cbor.decodeFromByteArray(kGroupsFile.readBytes())
|
||||||
} else {
|
} else {
|
||||||
|
if (!kGroupsFile.parentFile.exists()) {
|
||||||
|
kGroupsFile.parentFile.mkdirs()
|
||||||
|
}
|
||||||
kGroupsFile.createNewFile()
|
kGroupsFile.createNewFile()
|
||||||
kGroupsFile.writeBytes(Cbor.encodeToByteArray(GroupsData(mutableListOf())))
|
kGroupsFile.writeBytes(Cbor.encodeToByteArray(GroupsData(mutableListOf())))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user