Temasys / SkylinkJS

SkylinkJS Javascript WebRTC SDK
http://skylink.io/web
Other
275 stars 57 forks source link

ESS-1151: Set User Data not updating with new value #322

Closed ishannaithani closed 6 years ago

ishannaithani commented 6 years ago

Purpose of this PR

In peer-data.js the method for getting user data Skylink.prototype.getUserData has a faulty if block which checks if userData is null or undefined like below

if ( !(userData !== null && typeof userData === 'undefined') )

Hence, when userData was not a null value, the condition still would go inside the if block setting userData to blank string. Evaluated as ( !(true && false) ) => !(false) => true

This condition is now changed to below:

if ( !(userData !== null && typeof userData !== 'undefined') )

For more details, please refer to JIRA TICKET