Null-guard hook calls when supporting legacy attach hooks
4.1.1