Skip to content

Commit

Permalink
chore(form): address linting issue
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Jan 29, 2023
1 parent 5ef6a2e commit c17eae5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/src/core/consumed_thing.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ class ConsumedThing implements scripting_api.ConsumedThing {
client = servient.clientFor(scheme);
}

final form = foundForm.resolveUriVariables(options?.uriVariables);
final form =
foundForm.resolveUriVariables(options?.uriVariables) ?? foundForm;

return _ClientAndForm(client, form);
}
Expand Down
6 changes: 4 additions & 2 deletions lib/src/definitions/form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,9 @@ class Form {

/// Resolves all [uriVariables] in this [Form] and creates a copy with an
/// updated [resolvedHref].
Form resolveUriVariables(Map<String, Object>? uriVariables) {
///
/// Returns [Null] if the [href] field does not use any URI variables.
Form? resolveUriVariables(Map<String, Object>? uriVariables) {
final hrefUriVariables = _filterUriVariables(resolvedHref);

// Use global URI variables by default and override them with
Expand All @@ -313,7 +315,7 @@ class Form {
if (hrefUriVariables.isEmpty) {
// The href uses no uriVariables, therefore we can abort all further
// checks.
return this;
return null;
}

if (affordanceUriVariables.isEmpty) {
Expand Down

0 comments on commit c17eae5

Please sign in to comment.