Skip to content

Commit 320e3bd

Browse files
mdvaccameta-codesync[bot]
authored andcommitted
Fix UnsafeDereference: Replace !! with checkNotNull in FilterHelper (facebook#56116)
Summary: Pull Request resolved: facebook#56116 Fixed UnsafeDereference lint warning in FilterHelper.kt. Replaced `filters.getMap(i)!!` with `checkNotNull(filters.getMap(i))` in `isOnlyColorMatrixFilters` method to match the pattern used in other methods in the same class. changelog: [internal] internal Reviewed By: Abbondanzo Differential Revision: D96784843 fbshipit-source-id: d7e68e5228c6da966b34561609b167e9c16313a3
1 parent faeef2b commit 320e3bd

File tree

1 file changed

+3
-1
lines changed
  • packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager

1 file changed

+3
-1
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/FilterHelper.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
package com.facebook.react.uimanager
99

10+
import android.annotation.SuppressLint
1011
import android.annotation.TargetApi
1112
import android.graphics.BlendMode
1213
import android.graphics.BlendModeColorFilter
@@ -30,6 +31,7 @@ import kotlin.math.sin
3031
*
3132
* @see <a href="https://www.w3.org/TR/filter-effects-1/">CSS Filter Effects Module Level 1</a>
3233
*/
34+
@SuppressLint("UseRequiresApi")
3335
@TargetApi(31)
3436
internal object FilterHelper {
3537

@@ -104,7 +106,7 @@ internal object FilterHelper {
104106
}
105107

106108
for (i in 0 until filters.size()) {
107-
val filter = filters.getMap(i)!!.entryIterator.next()
109+
val filter = checkNotNull(filters.getMap(i)).entryIterator.next()
108110
val filterName = filter.key
109111
if (filterName == "blur" || filterName == "dropShadow") {
110112
return false

0 commit comments

Comments
 (0)