fixed NPEs

This commit is contained in:
Mariotaku Lee 2016-12-05 21:23:06 +08:00
parent 558491f4ee
commit 0925c2713c
4 changed files with 7 additions and 7 deletions

View File

@ -35,8 +35,8 @@ android {
applicationId "org.mariotaku.twidere" applicationId "org.mariotaku.twidere"
minSdkVersion 14 minSdkVersion 14
targetSdkVersion 25 targetSdkVersion 25
versionCode 217 versionCode 218
versionName '3.2.13' versionName '3.3.0'
multiDexEnabled true multiDexEnabled true
buildConfigField 'boolean', 'LEAK_CANARY_ENABLED', 'Boolean.parseBoolean("false")' buildConfigField 'boolean', 'LEAK_CANARY_ENABLED', 'Boolean.parseBoolean("false")'

View File

@ -226,7 +226,7 @@ public abstract class TabConfiguration {
this.view = view; this.view = view;
} }
public void onActivityResult(int requestCode, int resultCode, Intent data) { public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
} }

View File

@ -55,11 +55,11 @@ class UserExtraConfiguration(key: String) : TabConfiguration.ExtraConfiguration(
hintView.visibility = View.VISIBLE hintView.visibility = View.VISIBLE
} }
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent) { override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
when (requestCode) { when (requestCode) {
1 -> { 1 -> {
if (resultCode == Activity.RESULT_OK) { if (resultCode == Activity.RESULT_OK) {
val user: ParcelableUser = data.getParcelableExtra(EXTRA_USER) val user: ParcelableUser = data!!.getParcelableExtra(EXTRA_USER)
viewHolder.display(user, dependencyHolder.mediaLoader, dependencyHolder.userColorNameManager, true) viewHolder.display(user, dependencyHolder.mediaLoader, dependencyHolder.userColorNameManager, true)
viewHolder.view.visibility = View.VISIBLE viewHolder.view.visibility = View.VISIBLE
hintView.visibility = View.GONE hintView.visibility = View.GONE

View File

@ -55,11 +55,11 @@ class UserListExtraConfiguration(key: String) : TabConfiguration.ExtraConfigurat
hintView.visibility = View.VISIBLE hintView.visibility = View.VISIBLE
} }
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent) { override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
when (requestCode) { when (requestCode) {
1 -> { 1 -> {
if (resultCode == Activity.RESULT_OK) { if (resultCode == Activity.RESULT_OK) {
val userList: ParcelableUserList = data.getParcelableExtra(EXTRA_USER_LIST) val userList: ParcelableUserList = data!!.getParcelableExtra(EXTRA_USER_LIST)
viewHolder.display(userList, dependencyHolder.mediaLoader, viewHolder.display(userList, dependencyHolder.mediaLoader,
dependencyHolder.userColorNameManager, true) dependencyHolder.userColorNameManager, true)
viewHolder.itemView.visibility = View.VISIBLE viewHolder.itemView.visibility = View.VISIBLE