Skip to content

Commit

Permalink
correctly handle file paths for actionButtonPath if it is not passed …
Browse files Browse the repository at this point in the history
…with file://
  • Loading branch information
erikng committed Jan 18, 2024
1 parent 4cb1bc3 commit ab4f977
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Nudge/Utilities/Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -781,9 +781,16 @@ struct UIUtilities {
return nil
}

return URL(string: actionButtonPath) ?? URL(fileURLWithPath: actionButtonPath)
// Check if the string is a URL with a scheme
if URL(string: actionButtonPath)?.scheme != nil {
return URL(string: actionButtonPath)
} else {
// It's a file path
return URL(fileURLWithPath: actionButtonPath)
}
}


if AppStateManager().requireMajorUpgrade() {
if majorUpgradeAppPathExists {
return URL(fileURLWithPath: OSVersionRequirementVariables.majorUpgradeAppPath)
Expand Down

0 comments on commit ab4f977

Please sign in to comment.