mirror of
https://github.com/Skysamara/android-kotlin-fundamentals-apps.git
synced 2025-12-06 06:16:03 +00:00
Merge pull request #23 from google-developer-training/developer
Fix: KotlinNullPointerException in LiveData when attempting to get a …
This commit is contained in:
commit
4a9a01d550
@ -114,7 +114,7 @@ class DevByteViewModel(application: Application) : AndroidViewModel(application)
|
|||||||
|
|
||||||
} catch (networkError: IOException) {
|
} catch (networkError: IOException) {
|
||||||
// Show a Toast error message and hide the progress bar.
|
// Show a Toast error message and hide the progress bar.
|
||||||
if(playlist.value!!.isEmpty())
|
if(playlist.value.isNullOrEmpty())
|
||||||
_eventNetworkError.value = true
|
_eventNetworkError.value = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -114,7 +114,7 @@ class DevByteViewModel(application: Application) : AndroidViewModel(application)
|
|||||||
|
|
||||||
} catch (networkError: IOException) {
|
} catch (networkError: IOException) {
|
||||||
// Show a Toast error message and hide the progress bar.
|
// Show a Toast error message and hide the progress bar.
|
||||||
if(playlist.value!!.isEmpty())
|
if(playlist.value.isNullOrEmpty())
|
||||||
_eventNetworkError.value = true
|
_eventNetworkError.value = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user