mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-27 23:40:33 +05:30
share dialog crash fixed
This commit is contained in:
parent
3260bd6b7a
commit
a8f90405a9
@ -207,7 +207,7 @@ class MainActivity : AppCompatActivity() {
|
||||
val bundle = Bundle()
|
||||
bundle.putString("videoId", watch)
|
||||
// for time stamped links
|
||||
if (data.query?.contains("t=")!!) {
|
||||
if (data.query != null && data.query?.contains("t=")!!) {
|
||||
val timeStamp = data.query.toString().split("t=")[1]
|
||||
bundle.putLong("timeStamp", timeStamp.toLong())
|
||||
}
|
||||
@ -227,7 +227,7 @@ class MainActivity : AppCompatActivity() {
|
||||
var bundle = Bundle()
|
||||
bundle.putString("videoId", watch.replace("v=", ""))
|
||||
// for time stamped links
|
||||
if (data.query?.contains("t=")!!) {
|
||||
if (data.query != null && data.query?.contains("t=")!!) {
|
||||
val timeStamp = data.query.toString().split("t=")[1]
|
||||
bundle.putLong("timeStamp", timeStamp.toLong())
|
||||
}
|
||||
@ -237,7 +237,7 @@ class MainActivity : AppCompatActivity() {
|
||||
var bundle = Bundle()
|
||||
bundle.putString("videoId", watch)
|
||||
// for time stamped links
|
||||
if (data.query?.contains("t=")!!) {
|
||||
if (data.query != null && data.query?.contains("t=")!!) {
|
||||
val timeStamp = data.query.toString().split("t=")[1]
|
||||
bundle.putLong("timeStamp", timeStamp.toLong())
|
||||
}
|
||||
|
@ -36,6 +36,7 @@ class DescriptionAdapter(
|
||||
lateinit var bitmap: Bitmap
|
||||
val thread = Thread {
|
||||
try {
|
||||
// try to parse the thumbnailUrl to a Bitmap
|
||||
val inputStream = URL(thumbnailUrl).openStream()
|
||||
bitmap = BitmapFactory.decodeStream(inputStream)
|
||||
} catch (ex: java.lang.Exception) {
|
||||
@ -44,6 +45,7 @@ class DescriptionAdapter(
|
||||
}
|
||||
thread.start()
|
||||
thread.join()
|
||||
// return bitmap if initialized
|
||||
return try {
|
||||
bitmap
|
||||
} catch (e: Exception) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user