Add null check when checking for mongoose or promises

I'm using baucis as middleware and those calls (and potentially others) produce nulls that should be checked and ignored.