Null Sprite not being detected as null?

Isn’t it possible to check if a sprite variable is null? The following code specifically checks whether a sprite variable (set in the inspector) is null or not, but if it’s null it still passes through the check and then causes a null reference error on the line that stores the sprite reference into a UI image element.

Sprite IconSprite = OMDScript.Icon;
if (IconSprite != null) CarriedInventoryUIImageArray*.sprite = IconSprite;*
I can’t see any logic error in the code, so why isn’t it detecting that a sprite is null ?

What is it’s value if you log it using “Debug.Log(IconSprite)”?

It’s now detecting it as “null” for some reason, so I don’t know what it used to register as. There have been a lot of temporary quirks like this lately.