We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3b71db1 + c05250a commit 94eb9a6Copy full SHA for 94eb9a6
Parse/Internal/PFJSONSerialization.m
@@ -51,6 +51,13 @@ + (id)JSONObjectFromFileAtPath:(NSString *)filePath {
51
52
[stream open];
53
54
+ NSError *streamError = stream.streamError;
55
+ // Check if stream failed to open, because there is no such file.
56
+ if (streamError && [streamError.domain isEqualToString:NSPOSIXErrorDomain] && streamError.code == ENOENT) {
57
+ [stream close]; // Still close the stream.
58
+ return nil;
59
+ }
60
+
61
NSError *error = nil;
62
id object = [NSJSONSerialization JSONObjectWithStream:stream options:0 error:&error];
63
if (!object || error) {
0 commit comments