From 8cbd027a87e5a696664279778a879f575b2222f8 Mon Sep 17 00:00:00 2001 From: Ben Roth Date: Thu, 13 Apr 2017 11:28:24 -0700 Subject: [PATCH] Protect against fatal YellowBox error when stack frame has no file --- Libraries/ReactNative/YellowBox.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Libraries/ReactNative/YellowBox.js b/Libraries/ReactNative/YellowBox.js index ec30f1a84bfacd..458441f805f680 100644 --- a/Libraries/ReactNative/YellowBox.js +++ b/Libraries/ReactNative/YellowBox.js @@ -191,8 +191,13 @@ const StackRow = ({frame}: StackRowProps) => { const Text = require('Text'); const TouchableHighlight = require('TouchableHighlight'); const {file, lineNumber} = frame; - const fileParts = file.split('/'); - const fileName = fileParts[fileParts.length - 1]; + let fileName; + if (file) { + const fileParts = file.split('/'); + fileName = fileParts[fileParts.length - 1]; + } else { + fileName = ''; + } return (