Fix bug 1285958 avoid NPE when haFlag is null