test if err is "undefined" not !== null