[Android] Fix UninitializedPropertyAccessException

Nicolas Pomepuy git at videolan.org
Thu Oct 31 11:27:32 CET 2019


vlc-android | branch: 3.2.x | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Thu Oct 31 11:26:34 2019 +0100| [20b577d599a519942afc17d16bdc9dd07fdb92ea] | committer: Geoffrey Métais

Fix UninitializedPropertyAccessException

> https://code.videolan.org/videolan/vlc-android/commit/20b577d599a519942afc17d16bdc9dd07fdb92ea
---

 vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
index 8aaa29b9b..53df744e5 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
@@ -133,7 +133,6 @@ abstract class BaseBrowserFragment : MediaBrowserFragment<BrowserModel>(), IRefr
         viewModel.dataset.observe(this, Observer<MutableList<MediaLibraryItem>> { mediaLibraryItems -> adapter.update(mediaLibraryItems!!) })
         viewModel.getDescriptionUpdate().observe(this, Observer { pair -> if (pair != null) adapter.notifyItemChanged(pair.first, pair.second) })
         viewModel.loading.observe(this, Observer {
-
             (activity as? MainActivity)?.refreshing = it
         })
     }
@@ -182,7 +181,7 @@ abstract class BaseBrowserFragment : MediaBrowserFragment<BrowserModel>(), IRefr
     }
 
     override fun onDestroy() {
-        adapter.cancel()
+        if (::adapter.isInitialized) adapter.cancel()
         super.onDestroy()
     }
 



More information about the Android mailing list