Prevent the error instead of catching it! In this case, start the function with `if(!(user && position)) { return undefined; }` or some other similar check