diff options
Diffstat (limited to 'CyteKit')
-rw-r--r-- | CyteKit/extern.mm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/CyteKit/extern.mm b/CyteKit/extern.mm index 42317e1..cbf3774 100644 --- a/CyteKit/extern.mm +++ b/CyteKit/extern.mm @@ -98,12 +98,14 @@ void CyteInitialize(NSString *agent) { agent = [NSString stringWithFormat:@"%@ CyF/%.2f", agent, kCFCoreFoundationVersionNumber]; - if (RegEx match = RegEx("([0-9]+(\\.[0-9]+)+).*", safari)) - agent = [NSString stringWithFormat:@"Safari/%@ %@", match[1], agent]; + if (safari != nil) + if (RegEx match = RegEx("([0-9]+(\\.[0-9]+)+).*", safari)) + agent = [NSString stringWithFormat:@"Safari/%@ %@", match[1], agent]; if (RegEx match = RegEx("([0-9]+[A-Z][0-9]+[a-z]?).*", System_)) agent = [NSString stringWithFormat:@"Mobile/%@ %@", match[1], agent]; - if (RegEx match = RegEx("([0-9]+(\\.[0-9]+)+).*", product)) - agent = [NSString stringWithFormat:@"Version/%@ %@", match[1], agent]; + if (product != nil) + if (RegEx match = RegEx("([0-9]+(\\.[0-9]+)+).*", product)) + agent = [NSString stringWithFormat:@"Version/%@ %@", match[1], agent]; [CyteWebViewController setApplicationNameForUserAgent:agent]; } |