Skip to content

Commit

Permalink
Fixed bug with isEmpty
Browse files Browse the repository at this point in the history
  • Loading branch information
Slavik Urdzik committed Feb 7, 2020
1 parent 991f639 commit 24ada98
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import com.example.movieapp.domain.Movie
import com.example.movieapp.repository.MoviesRepository
import kotlinx.coroutines.launch


class OverviewViewModel(application: Application) : ViewModel() {

//LiveData object of movie
Expand Down Expand Up @@ -42,6 +41,9 @@ class OverviewViewModel(application: Application) : ViewModel() {
_eventNetworkError.value = false
_isNetworkErrorShown.value = false
} catch (e: Exception) {
if (playList.value.isNullOrEmpty()) {
_eventNetworkError.value = true
}
}
}
}
Expand Down

0 comments on commit 24ada98

Please sign in to comment.