Skip to content

Commit

Permalink
fix create bitmap crash
Browse files Browse the repository at this point in the history
  • Loading branch information
biezhihua committed Sep 11, 2024
1 parent 6df8682 commit 8eae53c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class GXBlurHelper(private val host: GXView) {
val width = host.layoutParams.width
val height = host.layoutParams.height

if (radius == 0f || width == 0 && height == 0) {
if (radius == 0f || width <= 0 && height <= 0) {
innerRelease()
return false
}
Expand Down Expand Up @@ -90,7 +90,7 @@ class GXBlurHelper(private val host: GXView) {
return false
}
r = true
} catch (e: OutOfMemoryError) {
} catch (e: Exception) {
// Bitmap.createBitmap() may cause OOM error
// Simply ignore and fallback
} finally {
Expand Down

0 comments on commit 8eae53c

Please sign in to comment.