From 86848129075aa6239a1d49139f8a76a07e3ccf9e Mon Sep 17 00:00:00 2001 From: Pritesh Nandgaonkar Date: Thu, 9 May 2019 07:18:56 -0700 Subject: [PATCH] check for the empty string Summary: Bug: {F157985015} Reviewed By: danielbuechele Differential Revision: D15260689 fbshipit-source-id: c43cdc0fc0d3e624ad930af60a9c95996579acb6 --- src/plugins/logs/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/logs/index.js b/src/plugins/logs/index.js index 38a349782..b5d95243f 100644 --- a/src/plugins/logs/index.js +++ b/src/plugins/logs/index.js @@ -58,6 +58,9 @@ const Icon = styled(Glyph)({ function getLineCount(str: string): number { let count = 1; + if (!(typeof str === 'string')) { + return 0; + } for (let i = 0; i < str.length; i++) { if (str[i] === '\n') { count++;