The TopoDS_Edge returned by XCAFDimTolObjects_DimensionObject::GetPath() is null

I have read a step file,and then i wanted to display the dimension.

A error occured when i was constructing PrsDim_DiameterDimension

//Get the dimension  from the dimension label.
//Handle(XCAFDoc_Dimension) Target

    ConsoleLog("Is Null");

//Display the dimension
aViewer.Context()->Display(new PrsDim_DiameterDimension(Target->GetObject()->GetPath()),true);

The log such as:

Is Null

The include file XCAFDimTolObjects_DimensionObject:

//! Access object to store dimension data
class XCAFDimTolObjects_DimensionObject : public Standard_Transient
//! Returns a 'curve' along which the dimension is measured.
  Standard_EXPORT TopoDS_Edge GetPath() const;