From f13c0b47da1488912ba2aa4be6471d6c110c9907 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 21 Jun 2015 14:44:40 -0400 Subject: [PATCH] Fix nil host replacement. --- Source/ProtocolClient.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/ProtocolClient.m b/Source/ProtocolClient.m index 5a0fa5f..eddb442 100644 --- a/Source/ProtocolClient.m +++ b/Source/ProtocolClient.m @@ -101,7 +101,9 @@ NSString* urlString = [url absoluteString]; // Remove the host because this is a file:// URL; - urlString = [urlString stringByReplacingOccurrencesOfString:[url host] withString:@""]; + NSString* host = [url host]; + if (host) + urlString = [urlString stringByReplacingOccurrencesOfString:[url host] withString:@""]; // Escape % for use in printf-style NSString formatters. urlString = [urlString stringByReplacingOccurrencesOfString:@"%" withString:@"%%"]; -- 2.43.5