coffeescript supports a handy `?` check.

```coffee
oState = window.optimizely?.data?.state
```