compiler/ecp: Fixed potential null pointer crash