I have a method where I get token from API:
let { Token } = await API.getToken({
postId: postId
})
if(){}
When token does not exist I see in the console that it's null warning. "Cannot read property 'Token' of null" Because API response itself is null. My goal is that if it shows that warning and it's null then use the logic inside if condition. I tried to use if(token==null) but it didn't work. How can be it done?