mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 22:30:30 +05:30
fix crash when importing playlists of wrong format
This commit is contained in:
parent
ff61ae4c7d
commit
f7e9df69ba
@ -115,8 +115,15 @@ class ImportHelper(
|
|||||||
val playlistFile = ObjectMapper().readValue(uri.readText(), ImportPlaylistFile::class.java)
|
val playlistFile = ObjectMapper().readValue(uri.readText(), ImportPlaylistFile::class.java)
|
||||||
|
|
||||||
CoroutineScope(Dispatchers.IO).launch {
|
CoroutineScope(Dispatchers.IO).launch {
|
||||||
playlistFile.playlists?.let {
|
try {
|
||||||
PlaylistsHelper.importPlaylists(activity, it)
|
playlistFile.playlists?.let {
|
||||||
|
PlaylistsHelper.importPlaylists(activity, it)
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e(TAG(), e.toString())
|
||||||
|
e.localizedMessage?.let {
|
||||||
|
activity.applicationContext.toastFromMainThread(it)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user