Source

SOExtendedAttributes / NSURL+SOExtendedAttributes.m

Diff from to

File NSURL+SOExtendedAttributes.m

         if (bufferSize == -1) 
         {
             attributeNames = nil;
-            *outError = SOPOSIXErrorForURL(self);
+           if (outError) *outError = SOPOSIXErrorForURL(self);
             return nil;
         }
         
     }
     else
     {
-        NSMutableDictionary *errInfo = [NSMutableDictionary dictionary];
-        [errInfo setObject:[NSString stringWithFormat:@"Value of class %@ cannot be serialized into a plist", NSStringFromClass([value class])] forKey:NSLocalizedDescriptionKey];
-        [errInfo setObject:value forKey:@"value"];
-        *outError = [NSError errorWithDomain:SOExtendedAttributesErrorDomain code:SOExtendedAttributesValueCantBeSerialized userInfo:errInfo];
+        if (outError)
+        {
+            NSMutableDictionary *errInfo = [NSMutableDictionary dictionary];
+            [errInfo setObject:[NSString stringWithFormat:@"Value of class %@ cannot be serialized into a plist", NSStringFromClass([value class])] forKey:NSLocalizedDescriptionKey];
+            [errInfo setObject:value forKey:@"value"];
+            *outError = [NSError errorWithDomain:SOExtendedAttributesErrorDomain code:SOExtendedAttributesValueCantBeSerialized userInfo:errInfo];
+        }
         return NO;
     }