fixed some crashes

This commit is contained in:
Mariotaku Lee 2017-01-21 13:34:49 +08:00
parent 9d0994153d
commit 680b7319f4
No known key found for this signature in database
GPG Key ID: 15C10F89D7C33535
3 changed files with 3 additions and 2 deletions

View File

@ -1 +0,0 @@
org.mariotaku.twidere.util.premium.DummyExtraFeaturesService

View File

@ -47,7 +47,9 @@ abstract class ExtraFeaturesService {
const val FEATURE_SCHEDULE_STATUS = "schedule_status"
fun newInstance(context: Context): ExtraFeaturesService {
val instance = ServiceLoader.load(ExtraFeaturesService::class.java).first()
val instance = ServiceLoader.load(ExtraFeaturesService::class.java).firstOrNull() ?: run {
return@run DummyExtraFeaturesService()
}
instance.init(context)
return instance
}