From 38d8bcc07c399089629d6acaf38ff53b6c773fae Mon Sep 17 00:00:00 2001 From: MM20 <15646950+MM2-0@users.noreply.github.com> Date: Mon, 22 Jul 2024 18:05:19 +0200 Subject: [PATCH] Fix NPE Close #967 --- .../main/java/de/mm20/launcher2/profiles/ProfileManager.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/profiles/src/main/java/de/mm20/launcher2/profiles/ProfileManager.kt b/core/profiles/src/main/java/de/mm20/launcher2/profiles/ProfileManager.kt index b0a9d7f6..76bcb260 100644 --- a/core/profiles/src/main/java/de/mm20/launcher2/profiles/ProfileManager.kt +++ b/core/profiles/src/main/java/de/mm20/launcher2/profiles/ProfileManager.kt @@ -35,6 +35,8 @@ class ProfileManager( private val context: Context, private val permissionsManager: PermissionsManager, ) { + private val mutex = Mutex() + private val userManager = context.getSystemService()!! private val launcherApps = context.getSystemService()!! @@ -92,8 +94,6 @@ class ProfileManager( } } } - - private val mutex = Mutex() private suspend fun refreshProfiles() { mutex.withLock { val profiles = mutableListOf()