Fix potential nil ptr seg fault and CI test issue

No match.