Fix bug where an undefined id would trigger a `findAll`

This has been observed by the eagle eyes of @stefanpenner, reported in issue #1705.