mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 16:00:31 +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()
|
val bundle = Bundle()
|
||||||
bundle.putString("videoId", watch)
|
bundle.putString("videoId", watch)
|
||||||
// for time stamped links
|
// 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]
|
val timeStamp = data.query.toString().split("t=")[1]
|
||||||
bundle.putLong("timeStamp", timeStamp.toLong())
|
bundle.putLong("timeStamp", timeStamp.toLong())
|
||||||
}
|
}
|
||||||
@ -227,7 +227,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
var bundle = Bundle()
|
var bundle = Bundle()
|
||||||
bundle.putString("videoId", watch.replace("v=", ""))
|
bundle.putString("videoId", watch.replace("v=", ""))
|
||||||
// for time stamped links
|
// 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]
|
val timeStamp = data.query.toString().split("t=")[1]
|
||||||
bundle.putLong("timeStamp", timeStamp.toLong())
|
bundle.putLong("timeStamp", timeStamp.toLong())
|
||||||
}
|
}
|
||||||
@ -237,7 +237,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
var bundle = Bundle()
|
var bundle = Bundle()
|
||||||
bundle.putString("videoId", watch)
|
bundle.putString("videoId", watch)
|
||||||
// for time stamped links
|
// 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]
|
val timeStamp = data.query.toString().split("t=")[1]
|
||||||
bundle.putLong("timeStamp", timeStamp.toLong())
|
bundle.putLong("timeStamp", timeStamp.toLong())
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@ class DescriptionAdapter(
|
|||||||
lateinit var bitmap: Bitmap
|
lateinit var bitmap: Bitmap
|
||||||
val thread = Thread {
|
val thread = Thread {
|
||||||
try {
|
try {
|
||||||
|
// try to parse the thumbnailUrl to a Bitmap
|
||||||
val inputStream = URL(thumbnailUrl).openStream()
|
val inputStream = URL(thumbnailUrl).openStream()
|
||||||
bitmap = BitmapFactory.decodeStream(inputStream)
|
bitmap = BitmapFactory.decodeStream(inputStream)
|
||||||
} catch (ex: java.lang.Exception) {
|
} catch (ex: java.lang.Exception) {
|
||||||
@ -44,6 +45,7 @@ class DescriptionAdapter(
|
|||||||
}
|
}
|
||||||
thread.start()
|
thread.start()
|
||||||
thread.join()
|
thread.join()
|
||||||
|
// return bitmap if initialized
|
||||||
return try {
|
return try {
|
||||||
bitmap
|
bitmap
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user