Ricorda che dereferenziare NULL non ti garantisce un errore - semplicemente vai in "undefined behavior", per cui potrebbe succedere qualunque cosa. Con ogni probabilità getComponent ti sta restituendo NULL, ma dato che test() non usa il this non vedi alcun comportamento anomalo.