Skip to content

Commit

Permalink
remove bad log event when using latest* values
Browse files Browse the repository at this point in the history
  • Loading branch information
erikng committed Jul 16, 2024
1 parent b8255f7 commit bb0fa25
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Nudge/Utilities/Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1433,8 +1433,19 @@ struct VersionManager {
}

static func getMajorRequiredNudgeOSVersion() -> Int {
guard let majorVersion = Int(nudgePrimaryState.requiredMinimumOSVersion.split(separator: ".").first ?? "") else {
LogManager.error("Invalid format for requiredMinimumOSVersion - value is \(nudgePrimaryState.requiredMinimumOSVersion)", logger: utilsLog)
let requiredVersion = nudgePrimaryState.requiredMinimumOSVersion

// Handle new string values directly
switch requiredVersion {
case "latest", "latest-minor", "latest-supported":
return 0
default:
break
}

// Existing logic for version numbers
guard let majorVersion = Int(requiredVersion.split(separator: ".").first ?? "") else {
LogManager.error("Invalid format for requiredMinimumOSVersion - value is \(requiredVersion)", logger: utilsLog)
return 0
}
logOSVersion(majorVersion, for: "Major required OS version")
Expand Down

0 comments on commit bb0fa25

Please sign in to comment.