From 4f0c9af0af93c5a84f733069b834aa227be2c526 Mon Sep 17 00:00:00 2001 From: Viktor De Pasquale Date: Tue, 19 Sep 2023 10:16:21 +0200 Subject: [PATCH] Fixed arithmetic exception --- .../java/movie/metropolis/app/screen/profile/LoginScreen.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/movie/metropolis/app/screen/profile/LoginScreen.kt b/app/src/main/java/movie/metropolis/app/screen/profile/LoginScreen.kt index 412e9d64..1a977526 100644 --- a/app/src/main/java/movie/metropolis/app/screen/profile/LoginScreen.kt +++ b/app/src/main/java/movie/metropolis/app/screen/profile/LoginScreen.kt @@ -12,6 +12,7 @@ import androidx.hilt.navigation.compose.hiltViewModel import kotlinx.coroutines.delay import movie.metropolis.app.model.LoginMode import movie.style.AppImage +import kotlin.math.max @Composable fun LoginScreen( @@ -47,7 +48,7 @@ fun LoginScreen( } LaunchedEffect(index) { delay(5000) - index = (index + 1) % urls.size + index = (index + 1) % max(urls.size, 1) } when (viewModel.mode.collectAsState().value) { LoginMode.Login -> LoginSignInScreen(