Should BaseUri of StaticContext be of type Nullable<Uri>?

Added by Martin Honnen over 1 year ago

Looking for a workaround of the problems raised in I have read through which does

        public Uri BaseUri => new(Implementation.getStaticBaseURI());

but on the Java side or Saxon.Hej.expr.StaticContext the method getStaticBaseURI can return null.

That way I wonder, shouldn't the code better use a nullable Uri?:

        public Uri? BaseUri => Implementation.getStaticBaseURI() != null ? new(Implementation.getStaticBaseURI()) : null;

With the existing code new(Implementation.getStaticBaseURI()), I see an ArgumentNullException if Implementation.getStaticBaseURI() returns null.

Please register to reply