just 
```
} else if (!summary.id) {
```
summary.model is already checked != null