This could be: 

```
options.middleware = options.middleware || null;
```