瀏覽代碼

android: Don't update views if binding is null in onConfigurationChanged

Charles Lombardo 2 年之前
父節點
當前提交
ec388622ff
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt

+ 4 - 0
src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt

@@ -304,6 +304,10 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
 
     override fun onConfigurationChanged(newConfig: Configuration) {
         super.onConfigurationChanged(newConfig)
+        if (_binding == null) {
+            return
+        }
+
         updateScreenLayout()
         if (emulationActivity?.isInPictureInPictureMode == true) {
             if (binding.drawerLayout.isOpen) {