fix npe when logging error at export