summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2017-03-11 00:17:24 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2017-03-11 00:17:24 -0800
commit03191d515b8474764cc2a34dcc2284fcd158bce6 (patch)
treef23ad4eecbd6a52ef893b014cf5e5d94a31c962f
parentd60043e4dfdcd8321f94720ef885c55ad59a2b3d (diff)
Do not crash if Safari's Info.plist can't be read.v1.1.31
-rw-r--r--CyteKit/extern.mm10
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];
}