Эх сурвалжийг харах

fix: NullPointerException

tongmengxiao 2 сар өмнө
parent
commit
cdd5d8acb8

+ 7 - 1
baseswago/src/main/java/com/swago/baseswago/util/BitmapUtils.kt

@@ -74,7 +74,13 @@ object BitmapUtils {
                     } finally {
                         outputStream?.close()
                     }
-                    response?.invoke(resource.apply { density = 480 })
+                    try {
+                        response?.invoke(resource.apply { density = 480 })
+                    } catch (e: NullPointerException){
+                        LogUtil.d("BitmapUtils", "NullPointerException in onResourceReady: ${e.message}")
+                        e.printStackTrace()
+                    }
+
                 }
 
                 override fun onLoadCleared(placeholder: Drawable?) {