diff --git a/uhabits-android/src/main/java/org/isoron/uhabits/widgets/StackWidgetService.kt b/uhabits-android/src/main/java/org/isoron/uhabits/widgets/StackWidgetService.kt index 75018cead..0e60914e5 100644 --- a/uhabits-android/src/main/java/org/isoron/uhabits/widgets/StackWidgetService.kt +++ b/uhabits-android/src/main/java/org/isoron/uhabits/widgets/StackWidgetService.kt @@ -86,7 +86,7 @@ internal class StackRemoteViewsFactory(private val context: Context, intent: Int override fun getViewAt(position: Int): RemoteViews? { Log.i("StackRemoteViewsFactory", "getViewAt $position") - return if (position < 0 || position > remoteViews.size) null else remoteViews[position] + return if (0 <= position && position < remoteViews.size) remoteViews[position] else null } private fun constructWidget(