Skip to content
Snippets Groups Projects
Commit af941978 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Prevent ClassCastException

parent 6ad43bd7
No related branches found
No related tags found
No related merge requests found
......@@ -158,7 +158,7 @@ class StorageBrowserFragment : FileBrowserFragment(), EntryPointsEventsCb {
}
override fun onClick(v: View, position: Int, item: MediaLibraryItem) {
val mw = MediaWrapper((item as Storage).uri)
val mw = (item as? Storage)?.let { MediaWrapper(it.uri) } ?: return
mw.type = MediaWrapper.TYPE_DIR
browse(mw, position, (DataBindingUtil.findBinding<BrowserItemBinding>(v))?.browserCheckbox?.state == ThreeStatesCheckbox.STATE_CHECKED)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment