Temporary fix for npm

Temporary remedy for #1302, until `npm` fixes the issue.
Since you try/catch, check for null may be unnecessary.