insert non-null check into all code paths before calling Unsafe methods