Skip to content

Commit cee8426

Browse files
committed
fix: RN 0.77,x android nullability issue of path.getString()
1 parent d8dc402 commit cee8426

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

android/src/main/java/com/sourcetoad/reactnativesketchcanvas/RNTSketchCanvasManager.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ class RNTSketchCanvasViewManager :
133133
if (path != null) {
134134
for (i in 0 until path.size()) {
135135
val coor =
136-
path.getString(i).split(",".toRegex()).dropLastWhile { it.isEmpty() }
137-
.toTypedArray()
138-
if (pointPath != null) {
136+
path.getString(i)?.split(",".toRegex())?.dropLastWhile { it.isEmpty() }
137+
?.toTypedArray()
138+
if (coor != null && pointPath != null) {
139139
pointPath.add(PointF(coor[0].toFloat(), coor[1].toFloat()))
140140
}
141141
}

0 commit comments

Comments
 (0)