Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit b17f5d8

Browse files
committed
Fix release build error
1 parent 8c33cf7 commit b17f5d8

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Sources/WordPressShared/Dictionary+Helpers.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ extension Dictionary {
1212
/// - Returns: Value as a String (when possible!)
1313
///
1414
func valueAsString(forKey key: Key) -> String? {
15-
let value = self[key]
16-
switch value {
17-
case let string as String:
15+
guard let value = self[key] else {
16+
return nil
17+
}
18+
if let string = value as? String {
1819
return string
19-
case let number as NSNumber:
20+
} else if let number = value as? NSNumber {
2021
return number.description
21-
default:
22+
} else {
2223
return nil
2324
}
2425
}

0 commit comments

Comments
 (0)