Skip to content

Commit

Permalink
prevent calling valueForKeyPath if propertyMapping is nil.
Browse files Browse the repository at this point in the history
  • Loading branch information
DenTelezhkin committed Jul 7, 2016
1 parent 07d6d74 commit b3311dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion EasyMapping.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "EasyMapping"
s.version = "0.18.0"
s.version = "0.18.1"
s.summary = "The easiest way to map data from your webservice."
s.homepage = "https://github.com/lucasmedeirosleite/EasyMapping"
s.license = { :type => 'MIT', :file => 'LICENSE' }
Expand Down
2 changes: 2 additions & 0 deletions EasyMapping/EKPropertyHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ +(void)addValue:(id)value onObject:(id)object forKeyPath:(NSString *)keyPath

+ (id)getValueOfProperty:(EKPropertyMapping *)propertyMapping fromRepresentation:(NSDictionary *)representation ignoreMissingFields:(BOOL)ignoreMissingFields
{
if (propertyMapping == nil) return nil;
id value = nil;

if (propertyMapping.valueBlock) {
Expand All @@ -196,6 +197,7 @@ +(id)getValueOfManagedProperty:(EKPropertyMapping *)mapping
fromRepresentation:(NSDictionary *)representation
inContext:(NSManagedObjectContext *)context
{
if (mapping == nil) return nil;
id value = nil;

if (mapping.managedValueBlock) {
Expand Down

0 comments on commit b3311dd

Please sign in to comment.