Skip to content

Commit

Permalink
Fix "Passed nil into T.must" error
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieMagee committed Jul 7, 2024
1 parent 0a2cc23 commit d87d7b5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion common/lib/dependabot/update_checkers/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def latest_resolvable_version

# Lowest available security fix version not checking resolvability
# @return [Dependabot::<package manager>::Version, #to_s] version class
sig { overridable.returns(Dependabot::Version) }
sig { overridable.returns(T.nilable(Dependabot::Version)) }
def lowest_security_fix_version
raise NotImplementedError, "#{self.class} must implement #lowest_security_fix_version"
end
Expand Down
2 changes: 1 addition & 1 deletion go_modules/lib/dependabot/go_modules/update_checker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def lowest_resolvable_security_fix_version
lowest_security_fix_version
end

sig { override.returns(Dependabot::Version) }
sig { override.returns(T.nilable(Dependabot::Version)) }
def lowest_security_fix_version
latest_version_finder.lowest_security_fix_version
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def latest_version
@latest_version ||= T.let(fetch_latest_version, T.nilable(Dependabot::Version))
end

sig { returns(Dependabot::Version) }
sig { returns(T.nilable(Dependabot::Version)) }
def lowest_security_fix_version
@lowest_security_fix_version ||= T.let(fetch_lowest_security_fix_version, T.nilable(Dependabot::Version))
end
Expand Down Expand Up @@ -105,7 +105,7 @@ def fetch_latest_version
candidate_versions.max
end

sig { returns(Dependabot::Version) }
sig { returns(T.nilable(Dependabot::Version)) }
def fetch_lowest_security_fix_version
relevant_versions = available_versions
relevant_versions = filter_prerelease_versions(relevant_versions)
Expand All @@ -114,7 +114,7 @@ def fetch_lowest_security_fix_version
relevant_versions = filter_ignored_versions(relevant_versions)
relevant_versions = filter_lower_versions(relevant_versions)

T.must(relevant_versions.min)
relevant_versions.min
end

sig { returns(T::Array[Dependabot::Version]) }
Expand Down

0 comments on commit d87d7b5

Please sign in to comment.