Skip to content

Commit 16b8124

Browse files
yusuftorclaude
andcommitted
Use non-optional UUID init for zero-IDFA sentinel
UUID(uuidString:) returns Optional, which would silently make the equality check at the call site false if the literal ever failed to parse — the zero-IDFA sentinel would then slip through unfiltered. Switch to UUID(uuid:) which takes the 16-byte tuple directly and returns a non-optional, removing the optionality from the comparison without resorting to force-unwrap. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 94a618f commit 16b8124

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Sources/SuperwallKit/Analytics/Attribution/AttributionFetcher.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ final class AttributionFetcher {
5656
return nil
5757
}
5858

59-
private static let zeroAdvertisingIdentifier = UUID(uuidString: "00000000-0000-0000-0000-000000000000")
59+
// Non-optional construction via `init(uuid:)` — `init(uuidString:)` returns
60+
// an Optional which would make the equality check silently false-positive
61+
// if the literal ever failed to parse.
62+
private static let zeroAdvertisingIdentifier = UUID(uuid: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))
6063

6164
/// Whether this build/environment can ever produce an AdServices token.
6265
/// `false` on builds that didn't link AdServices.framework and on debug

0 commit comments

Comments
 (0)