Authored by Justin R. Miller

closes #291: merge in parts of @RubioV/RMBingSource-offline-crash-fix

... ... @@ -85,7 +85,11 @@
NSArray *URLs = [self URLsForTile:tile];
if ([URLs count] > 1)
if ([URLs count] == 0)
{
return nil;
}
else if ([URLs count] > 1)
{
// fill up collection array with placeholders
//
... ...
... ... @@ -27,7 +27,7 @@
#import "RMAbstractWebMapSource.h"
typedef enum NSUInteger {
typedef enum : NSUInteger {
RMBingImagerySetRoad = 0, // default
RMBingImagerySetAerial = 1,
RMBingImagerySetAerialWithLabels = 2,
... ...
... ... @@ -75,7 +75,10 @@
NSData *metadataData = [NSData brandedDataWithContentsOfURL:metadataURL];
id metadata = [NSJSONSerialization JSONObjectWithData:metadataData options:0 error:nil];
if ( ! metadataData)
return nil;
id metadata = [NSJSONSerialization JSONObjectWithData:metadataData options:0 error:NULL];
if (metadata && [metadata isKindOfClass:[NSDictionary class]] && [[metadata objectForKey:@"statusCode"] intValue] == 200)
{
... ...