adding some crashfixes

This commit is contained in:
tibbi 2019-07-29 17:46:13 +02:00
parent 29f8f449b9
commit bc3683deb9
3 changed files with 7 additions and 3 deletions

View file

@ -693,7 +693,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
return false
}
private fun getCurrentFragment() = (view_pager.adapter as MyPagerAdapter).getCurrentFragment(view_pager.currentItem)
private fun getCurrentFragment() = (view_pager.adapter as? MyPagerAdapter)?.getCurrentFragment(view_pager.currentItem)
private fun showProperties() {
if (getCurrentMedium() != null) {

View file

@ -623,7 +623,7 @@ fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImag
try {
val currMedia = mediumDao.getMediaFromPath(it)
media.addAll(currMedia)
} catch (ignored: IllegalStateException) {
} catch (ignored: Exception) {
}
}

View file

@ -44,7 +44,11 @@ class NewPhotoFetcher : JobService() {
addTriggerContentUri(JobInfo.TriggerContentUri(photoUri, JobInfo.TriggerContentUri.FLAG_NOTIFY_FOR_DESCENDANTS))
addTriggerContentUri(JobInfo.TriggerContentUri(videoUri, JobInfo.TriggerContentUri.FLAG_NOTIFY_FOR_DESCENDANTS))
addTriggerContentUri(JobInfo.TriggerContentUri(MEDIA_URI, 0))
context.getSystemService(JobScheduler::class.java).schedule(build())
try {
context.getSystemService(JobScheduler::class.java).schedule(build())
} catch (ignored: Exception) {
}
}
}