what's the difference between what is returned here and what is passed into this function?  I almost think we should be checking what's passed in since we use it in the else case for the outer if to get a pointer to the brackets js api.  

Otherwise I think this change is fine -- just trying to explore solutions for other CEF crashers...