Skip to content

Commit e053210

Browse files
committed
Analysis: Resolve unnecessary safe call type warning
Warning Message: "Unnecessary safe call on a non-null receiver of type CharSequence. This expression will have nullable type in future releases" The 'mPositiveButtonLabel' is being reverted back to being a nullable field, that is, instead of it being a 'lateinit' non-null field. PS: This field was nullable in the past, but this 24a0532 commit made it into 'lateinit' non-null.
1 parent 01c90d2 commit e053210

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libs/editor/src/main/java/org/wordpress/android/editor/gutenberg/GutenbergDialogFragment.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder
1111
class GutenbergDialogFragment : AppCompatDialogFragment() {
1212
private lateinit var mTag: String
1313
private lateinit var mMessage: CharSequence
14-
private lateinit var mPositiveButtonLabel: CharSequence
14+
private var mPositiveButtonLabel: CharSequence? = null
1515
private var mTitle: CharSequence? = null
1616
private var mNegativeButtonLabel: CharSequence? = null
1717
private var mId: Int = 0
@@ -56,7 +56,7 @@ class GutenbergDialogFragment : AppCompatDialogFragment() {
5656
mTag = requireNotNull(savedInstanceState.getString(STATE_KEY_TAG))
5757
mTitle = savedInstanceState.getCharSequence(STATE_KEY_TITLE)
5858
mMessage = requireNotNull(savedInstanceState.getCharSequence(STATE_KEY_MESSAGE))
59-
mPositiveButtonLabel = requireNotNull(savedInstanceState.getCharSequence(STATE_KEY_POSITIVE_BUTTON_LABEL))
59+
mPositiveButtonLabel = savedInstanceState.getCharSequence(STATE_KEY_POSITIVE_BUTTON_LABEL)
6060
mNegativeButtonLabel = savedInstanceState.getCharSequence(STATE_KEY_NEGATIVE_BUTTON_LABEL)
6161
mId = savedInstanceState.getInt(STATE_KEY_ID)
6262
}

0 commit comments

Comments
 (0)