فهرست منبع

Handle starting the server with nil options

Pierre-Olivier Latour 10 سال پیش
والد
کامیت
9c33c83351
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      GCDWebServer/Core/GCDWebServer.m

+ 1 - 1
GCDWebServer/Core/GCDWebServer.m

@@ -664,7 +664,7 @@ static inline NSString* _EncodeBase64(NSString* string) {
 
 - (BOOL)startWithOptions:(NSDictionary*)options error:(NSError**)error {
   if (_options == nil) {
-    _options = [options copy];
+    _options = options ? [options copy] : @{};
 #if TARGET_OS_IPHONE
     _suspendInBackground = [_GetOption(_options, GCDWebServerOption_AutomaticallySuspendInBackground, @YES) boolValue];
     if (((_suspendInBackground == NO) || ([[UIApplication sharedApplication] applicationState] != UIApplicationStateBackground)) && ![self _start:error])