Skip to content

Commit

Permalink
fix: Sentry crash fixes (#406)
Browse files Browse the repository at this point in the history
* fix: crash on click of clock

* fix: crash on parsing custom icon pack
  • Loading branch information
mslalith authored Mar 1, 2024
1 parent dc6b723 commit 12782a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ internal class IconPackXmlParser(
parseAppFilterXML()
}

fun drawableFor(componentName: String): Drawable? {
fun drawableFor(componentName: String): Drawable? = runCatching {
val set = iconPackToDrawablesMap[componentName]
if (set.isNullOrEmpty()) return null
val drawableInfo = set.firstOrNull { it is CalendarDrawableInfo } ?: set.first()
@Suppress("DEPRECATION")
return iconPackResources?.getDrawable(drawableInfo.getDrawableResId())
}
}.getOrNull()

@SuppressLint("DiscouragedApi")
@IgnoreNestedBlockDepth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ fun HomePage(


fun openClockApp() {
val intent = Intent(AlarmClock.ACTION_SHOW_ALARMS)
context.startActivity(intent)
runCatching {
val intent = Intent(AlarmClock.ACTION_SHOW_ALARMS)
context.startActivity(intent)
}
}

HomePage(
Expand Down

0 comments on commit 12782a3

Please sign in to comment.