Add checks for null users
This should allow things like requests and stat pages to display properly even if the database is corrupted with deleted users, by simply skipping the entries for which users are missing.

More changes to add null checks in other code paths are still to come.