diff --git a/lib/src/json_schema/json_schema.dart b/lib/src/json_schema/json_schema.dart index 7c92d06d..c8cc02f4 100644 --- a/lib/src/json_schema/json_schema.dart +++ b/lib/src/json_schema/json_schema.dart @@ -305,7 +305,10 @@ class JsonSchema { _customFormats = customFormats; _rootMemomizedPathResults = {}; try { - _fetchedFromUriBase = JsonSchemaUtils.getBaseFromFullUri(_fetchedFromUri!); + // Only fetch the base if given + if (_fetchedFromUri != null) { + _fetchedFromUriBase = JsonSchemaUtils.getBaseFromFullUri(_fetchedFromUri!); + } } catch (e) { // ID base can't be set for schemes other than HTTP(S). // This is expected behavior.