Skip to content

Commit 562ea3e

Browse files
authored
fix: check nullability before placing widget (#184)
* fix: check nullability before placing widget See: #182 * docs: update changelog
1 parent 7a0741f commit 562ea3e

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- Addressed crash on startup due to widgets ([#182])
13+
1014
## [1.1.3] - 2025-06-19
1115

1216
### Changed
@@ -81,3 +85,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8185
[#65]: https://github.com/FossifyOrg/Launcher/issues/65
8286
[#74]: https://github.com/FossifyOrg/Launcher/issues/74
8387
[#115]: https://github.com/FossifyOrg/Launcher/issues/115
88+
[#182]: https://github.com/FossifyOrg/Launcher/issues/182

app/src/main/kotlin/org/fossify/home/views/HomeScreenGrid.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,10 +1266,15 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) :
12661266
gridItems
12671267
.filter { it.type == ITEM_TYPE_WIDGET && !it.outOfBounds() }
12681268
.forEach { item ->
1269-
val appWidgetProviderInfo = item.providerInfo
1269+
val providerInfo = item.providerInfo
12701270
?: appWidgetManager!!.installedProviders
12711271
.firstOrNull { it.provider.className == item.className }
1272-
placeAppWidget(appWidgetProviderInfo!!, item)
1272+
1273+
if (providerInfo != null) {
1274+
placeAppWidget(providerInfo, item)
1275+
} else {
1276+
removeWidget(item)
1277+
}
12731278
}
12741279
} else {
12751280
gridItems

0 commit comments

Comments
 (0)