From a36a676d4313225bbcec44120eb38ce871106d0a Mon Sep 17 00:00:00 2001 From: Bohdan Artiukhov <69891500+bohdanprog@users.noreply.github.com> Date: Thu, 20 Jun 2024 14:16:39 +0200 Subject: [PATCH] fix: android PathParser crash app if pass some wrong d prop (#2308) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #2086 # Summary The application crashes if an error is thrown when something goes wrong during path parse. ## Test Plan You can easily check in that component `Test2086` how it works after the fix. ## Compatibility | OS | Implemented | | ------- | :---------: | | iOS | ✅ | | Android | ✅ | --- TestsExample/App.js | 1 + TestsExample/src/Test2086.tsx | 45 +++++++++++++++++++ .../main/java/com/horcrux/svg/PathParser.java | 18 ++++---- 3 files changed, 54 insertions(+), 10 deletions(-) create mode 100644 TestsExample/src/Test2086.tsx diff --git a/TestsExample/App.js b/TestsExample/App.js index 39724f5f..96451eb3 100644 --- a/TestsExample/App.js +++ b/TestsExample/App.js @@ -10,6 +10,7 @@ import Test1845 from './src/Test1845'; import Test1986 from './src/Test1986'; import Test2071 from './src/Test2071'; import Test2080 from './src/Test2080'; +import Test2086 from './src/Test2086'; import Test2089 from './src/Test2089'; import Test2148 from './src/Test2148'; import Test2196 from './src/Test2196'; diff --git a/TestsExample/src/Test2086.tsx b/TestsExample/src/Test2086.tsx new file mode 100644 index 00000000..ef478d64 --- /dev/null +++ b/TestsExample/src/Test2086.tsx @@ -0,0 +1,45 @@ +import React, {useState} from 'react'; +import Svg, {Path} from 'react-native-svg'; +import {StyleSheet, Text, View, Button} from 'react-native'; + +export default function Test2086() { + const [display, setDisplay] = useState(false); + return ( + + + Click on the button to crash the app +