TSoftObjectPtr null even when set in editor

I set a data asset that has a TSoftObjectPtr to a UStaticMesh on an actor in the editor but when I try to use the ptr in my C++ code in the editor to set the mesh the ptr is always null.