Skip to content

Commit

Permalink
Merge pull request #612 from mikepenz/fix/609_2
Browse files Browse the repository at this point in the history
Log on missing font
  • Loading branch information
mikepenz authored Nov 6, 2021
2 parents ff5730a + 06f55f2 commit 0e298f9
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ fun IconicsDrawable.icon(icon: String): IconicsDrawable {
Log.e("IconicsDrawable", "Iconics.init() not yet executed, icon will be missing")
}
try {
Iconics.findFont(icon.iconPrefix)?.let { icon(it.getIcon(icon.clearedIconName)) }
val foundFont = Iconics.findFont(icon.iconPrefix)
if (foundFont == null) {
Log.w("IconicsDrawable", "No font identified matching the given `${icon.iconPrefix}` prefix")
} else {
icon(foundFont.getIcon(icon.clearedIconName))
}
} catch (ex: Exception) {
Iconics.logger.log(Log.ERROR, Iconics.TAG, "Wrong icon name: $icon")
}
Expand Down

0 comments on commit 0e298f9

Please sign in to comment.