From d7b607c25a34bd02310427606a2659317ca5e17f Mon Sep 17 00:00:00 2001 From: csantosm <4a.santos@gmail.com> Date: Tue, 26 Jan 2021 13:45:23 +0100 Subject: [PATCH] openvidu-react-native: Fixed crash with JSON parse --- openvidu-react-native/App.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/openvidu-react-native/App.js b/openvidu-react-native/App.js index 41698dca..e1b0aa35 100644 --- a/openvidu-react-native/App.js +++ b/openvidu-react-native/App.js @@ -176,9 +176,11 @@ export default class App extends Component { getNicknameTag(stream) { // Gets the nickName of the user - if (stream.connection && JSON.parse(stream.connection.data) && JSON.parse(stream.connection.data).clientData) { - return JSON.parse(stream.connection.data).clientData; - } + try { + if (stream.connection && JSON.parse(stream.connection.data) && JSON.parse(stream.connection.data).clientData) { + return JSON.parse(stream.connection.data).clientData; + } + } catch (error) { } return ''; }