This can be simplified to

```js
if(options && options.collection) {
```

See [plunkr](http://plnkr.co/edit/QIaxEx4vJKFKnz1p5qFE?p=preview).