Skip to content

Commit a88ab84

Browse files
committed
Resolve nullable warnings for API 31 migration
1 parent e254568 commit a88ab84

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

aztec/src/main/kotlin/org/wordpress/aztec/source/CssStyleFormatter.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package org.wordpress.aztec.source
22

3-
import androidx.core.text.TextDirectionHeuristicsCompat
43
import android.text.Editable
54
import android.text.Layout
65
import android.text.Spannable
76
import android.text.style.BackgroundColorSpan
87
import android.text.style.ForegroundColorSpan
8+
import androidx.core.text.TextDirectionHeuristicsCompat
99
import org.wordpress.aztec.AztecAttributes
1010
import org.wordpress.aztec.spans.IAztecAlignmentSpan
1111
import org.wordpress.aztec.spans.IAztecAttributedSpan
@@ -121,7 +121,7 @@ class CssStyleFormatter {
121121

122122
var styleAttributeValue = ""
123123
if (m.find()) {
124-
styleAttributeValue = m.group(1)
124+
m.group(1)?.let { styleAttributeValue = it }
125125
}
126126
return styleAttributeValue
127127
}

aztec/src/main/kotlin/org/wordpress/aztec/util/InstanceStateUtils.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package org.wordpress.aztec.util
22

33
import android.content.Context
44
import android.os.Bundle
5-
import android.text.TextUtils
65
import org.wordpress.android.util.AppLog
76
import java.io.File
87
import java.io.FileInputStream
@@ -50,7 +49,7 @@ class InstanceStateUtils {
5049
// the full path is kept in the bundle so, get it from there
5150
val filename = bundle.getString(cacheFilenameKey(varName))
5251

53-
if (TextUtils.isEmpty(filename)) {
52+
if (filename.isNullOrEmpty()) {
5453
return defaultValue
5554
}
5655

aztec/src/main/kotlin/org/wordpress/aztec/watchers/DeleteMediaElementWatcherAPI25AndHigher.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class DeleteMediaElementWatcherAPI25AndHigher(aztecText: AztecText) : TextWatche
3939
// real user deletions.
4040
aztecTextRef.get()?.postDelayed({
4141
while (!queueHasBeenPopulatedInThisTimeframe && deletedSpans.isNotEmpty()) {
42-
deletedSpans.poll().onMediaDeleted()
42+
deletedSpans.poll()?.onMediaDeleted()
4343
}
4444
queueHasBeenPopulatedInThisTimeframe = false
4545
}, 500)

0 commit comments

Comments
 (0)