Skip to content

Commit

Permalink
Fixed potential ClassCastException
Browse files Browse the repository at this point in the history
  • Loading branch information
travis-j-smith authored and dturner committed Nov 1, 2021
1 parent 566bfe7 commit 3eaadaa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/src/main/java/com/example/android/uamp/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,6 @@ class MainActivity : AppCompatActivity() {
private fun isRootId(mediaId: String) = mediaId == viewModel.rootMediaId.value

private fun getBrowseFragment(mediaId: String): MediaItemFragment? {
return supportFragmentManager.findFragmentByTag(mediaId) as MediaItemFragment?
return supportFragmentManager.findFragmentByTag(mediaId) as? MediaItemFragment
}
}

0 comments on commit 3eaadaa

Please sign in to comment.