Call sentry only when it was set up.

Fixes issue #1727.

<!---
@huboard:{"order":66.8125}
-->