File tree 2 files changed +6
-3
lines changed
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,8 @@ class ConsumedThing implements scripting_api.ConsumedThing {
114
114
client = servient.clientFor (scheme);
115
115
}
116
116
117
- final form = foundForm.resolveUriVariables (options? .uriVariables);
117
+ final form =
118
+ foundForm.resolveUriVariables (options? .uriVariables) ?? foundForm;
118
119
119
120
return _ClientAndForm (client, form);
120
121
}
Original file line number Diff line number Diff line change @@ -301,7 +301,9 @@ class Form {
301
301
302
302
/// Resolves all [uriVariables] in this [Form] and creates a copy with an
303
303
/// updated [resolvedHref] .
304
- Form resolveUriVariables (Map <String , Object >? uriVariables) {
304
+ ///
305
+ /// Returns [Null] if the [href] field does not use any URI variables.
306
+ Form ? resolveUriVariables (Map <String , Object >? uriVariables) {
305
307
final hrefUriVariables = _filterUriVariables (resolvedHref);
306
308
307
309
// Use global URI variables by default and override them with
@@ -313,7 +315,7 @@ class Form {
313
315
if (hrefUriVariables.isEmpty) {
314
316
// The href uses no uriVariables, therefore we can abort all further
315
317
// checks.
316
- return this ;
318
+ return null ;
317
319
}
318
320
319
321
if (affordanceUriVariables.isEmpty) {
You can’t perform that action at this time.
0 commit comments