mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
add a null check at photo fragment
This commit is contained in:
@@ -237,6 +237,9 @@ class PhotoFragment : ViewPagerFragment() {
|
|||||||
val height = bitmapOptions.outHeight
|
val height = bitmapOptions.outHeight
|
||||||
val bitmapAspectRatio = height / (width).toFloat()
|
val bitmapAspectRatio = height / (width).toFloat()
|
||||||
|
|
||||||
|
if (context == null)
|
||||||
|
return 2f
|
||||||
|
|
||||||
return if (context.portrait && bitmapAspectRatio <= 1f) {
|
return if (context.portrait && bitmapAspectRatio <= 1f) {
|
||||||
ViewPagerActivity.screenHeight / height.toFloat()
|
ViewPagerActivity.screenHeight / height.toFloat()
|
||||||
} else if (!context.portrait && bitmapAspectRatio >= 1f) {
|
} else if (!context.portrait && bitmapAspectRatio >= 1f) {
|
||||||
|
Reference in New Issue
Block a user