From 17a5d2be5a96703ed1c76d89990a8f1e37abd4d4 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Tue, 31 Dec 2024 13:29:48 +0100 Subject: [PATCH] [0.77] Fix RN-Tester JSC instacrashing (#48417) --- .../com/facebook/react/devsupport/StackTraceHelper.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/StackTraceHelper.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/StackTraceHelper.java index d901f8b2f73c79..994fe94bdafa7f 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/StackTraceHelper.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/StackTraceHelper.java @@ -268,8 +268,12 @@ public static JavaOnlyMap convertParsedError(ParsedError error) { List readableMapList = new ArrayList<>(); for (ParsedError.StackFrame frame : frames) { JavaOnlyMap map = new JavaOnlyMap(); - map.putDouble(COLUMN_KEY, frame.getColumn()); - map.putDouble(LINE_NUMBER_KEY, frame.getLineNumber()); + if (frame.getColumn() != null) { + map.putDouble(COLUMN_KEY, frame.getColumn()); + } + if (frame.getLineNumber() != null) { + map.putDouble(LINE_NUMBER_KEY, frame.getLineNumber()); + } map.putString(FILE_KEY, (String) frame.getFile()); map.putString(METHOD_NAME_KEY, (String) frame.getMethodName()); readableMapList.add(map);