I think, this will throw an error, if no model is available. It should rather be:

```
$model = $this->getModel(false);
if($model!===null) {
```