You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.
What steps will reproduce the problem?
1. Run the Drive Sample Application and attempt to delete a file after signing
in
Expected results:
File is deleted and query callback occurs displaying an alert informing that
the file has been deleted
Actual results:
File is deleted remotely and assertion occurs in the code: GTL_ASSERT([json
count] != 0, @"Creating object from empty json");
What version of the product are you using? build from 6-Aug-2012
On what operating system? OSX Lion
Apparently, the drive server used to return no data when deleting a file, but
now it returns JSON with an empty results array. This breaks the code.
A fix is below:
in GTLService.m parseObjectyFromDataOfFetcher:
//DEFECT WORKAROUND FOR GTLSERVICE - Google API now does return JSON data for deletes, but the JSON array for result is blank. Check json count and ignore if empty
if (json != nil && [json count]>0) {
...
} else if (!isREST) {
NSMutableDictionary *errorJSON = [jsonWrapper valueForKey:@"error"];
//DEFECT WORKAROUND PART 2: Don't assert on no error due to the situation described above.
if(errorJSON!=nil){
GTL_DEBUG_ASSERT(errorJSON != nil, @"no result or error in response:\n%@",
jsonWrapper);
GTLErrorObject *errorObject = [GTLErrorObject objectWithJSON:errorJSON];
NSError *error = [errorObject foundationError];
// Store the error and let it go to the callback
[properties setValue:error
forKey:kFetcherFetchErrorKey];
}
}
}
Original issue reported on code.google.com by joels...@gmail.com on 10 Sep 2012 at 10:20
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
joels...@gmail.com
on 10 Sep 2012 at 10:20The text was updated successfully, but these errors were encountered: