Added conditional to stop nil errors on sentry.js