Skip to content
This repository has been archived by the owner on Jan 28, 2024. It is now read-only.

Fix null inference weirdness #605

Merged
merged 1 commit into from
Aug 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/src/config_provider/config_spec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ class StringConfigSpec<RE extends Object?> extends ConfigSpec<String, RE> {
if (!o.checkType<String>(log: log)) {
return false;
}
if (_regexp != null && !_regexp.hasMatch(o.value as String)) {
if (!(_regexp?.hasMatch(o.value as String) ?? true)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: does the ! bind stronger than the ??, I guess it does. Maybe add parenthesis.

if (log) {
_logger.severe(
"Expected value of key '${o.pathString}' to match pattern $pattern (Input - ${o.value}).");
Expand Down