Skip to content

Commit

Permalink
update to check for key isEmpty
Browse files Browse the repository at this point in the history
combine both guards
  • Loading branch information
levieggertcru committed Jun 21, 2024
1 parent 77146c7 commit 17aa86c
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ public class LocalizableStringsBundle {
}

public func stringForKey(key: String) -> String? {

let localizedString: String = bundle.localizedString(forKey: key, value: LocalizableStringsBundle.uniqueValue, table: nil)

guard !localizedString.isEmpty else {
guard !key.isEmpty else {
return nil
}

guard localizedString != LocalizableStringsBundle.uniqueValue else {
let localizedString: String = bundle.localizedString(forKey: key, value: LocalizableStringsBundle.uniqueValue, table: nil)

guard !localizedString.isEmpty && localizedString != LocalizableStringsBundle.uniqueValue else {
return nil
}

Expand Down

0 comments on commit 17aa86c

Please sign in to comment.