You should check on `err` first, since if `User` is undefined, this will crash when you try to access `.length`.