add a null check at photo fragment
This commit is contained in:
parent
034f3b5c56
commit
12a0cb9f0a
1 changed files with 3 additions and 0 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue