Skip to content

Commit

Permalink
ASConfiguration version check only when have json dict (#971)
Browse files Browse the repository at this point in the history
* fix SIMULATE_WEB_RESPONSE not imported #449

* Fix to make rangeMode update in right time

* remove uncessary assert

* avoid extra version log.

* check dictionary earlier
  • Loading branch information
wsdwsd0829 authored and Adlai-Holler committed Jun 19, 2018
1 parent a0e5f4c commit fa0ef6f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Source/ASConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@ @implementation ASConfiguration
- (instancetype)initWithDictionary:(NSDictionary *)dictionary
{
if (self = [super init]) {
autotype featureStrings = ASDynamicCast(dictionary[@"experimental_features"], NSArray);
autotype version = ASDynamicCast(dictionary[@"version"], NSNumber).integerValue;
if (version != ASConfigurationSchemaCurrentVersion) {
NSLog(@"Texture warning: configuration schema is old version (%zd vs %zd)", version, ASConfigurationSchemaCurrentVersion);
if (dictionary != nil) {
autotype featureStrings = ASDynamicCast(dictionary[@"experimental_features"], NSArray);
autotype version = ASDynamicCast(dictionary[@"version"], NSNumber).integerValue;
if (version != ASConfigurationSchemaCurrentVersion) {
NSLog(@"Texture warning: configuration schema is old version (%zd vs %zd)", version, ASConfigurationSchemaCurrentVersion);
}
self.experimentalFeatures = ASExperimentalFeaturesFromArray(featureStrings);
} else {
self.experimentalFeatures = kNilOptions;
}
self.experimentalFeatures = ASExperimentalFeaturesFromArray(featureStrings);
}
return self;
}
Expand Down

0 comments on commit fa0ef6f

Please sign in to comment.