Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanhimmelman committed Dec 18, 2015
1 parent cd6e4a7 commit c085ea1
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions ObjectMapper/Core/Map.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,12 @@ private func valueFor(keyPathComponents: ArraySlice<String>, dictionary: [String
} else if let dict = object as? [String : AnyObject] where keyPathComponents.count > 1 {
let tail = keyPathComponents.dropFirst()
return valueFor(tail, dictionary: dict)
} else {
}
else if let dict = object as? [AnyObject] where keyPathComponents.count > 1 {
let tail = keyPathComponents.dropFirst()
return valueFor(tail, dictionary: dict)
}
else {
return object
}
}
Expand All @@ -138,15 +143,17 @@ private func valueFor(keyPathComponents: ArraySlice<String>, dictionary: [AnyObj
if let keyPath = keyPathComponents.first,
let index = Int(keyPath) {

let object = dictionary[index]
if index >= 0 && index < dictionary.count {
let object = dictionary[index]

if object is NSNull {
return nil
} else if let dict = object as? [AnyObject] where keyPathComponents.count > 1 {
let tail = keyPathComponents.dropFirst()
return valueFor(tail, dictionary: dict)
} else {
return object
if object is NSNull {
return nil
} else if let dict = object as? [AnyObject] where keyPathComponents.count > 1 {
let tail = keyPathComponents.dropFirst()
return valueFor(tail, dictionary: dict)
} else {
return object
}
}
}
return nil
Expand Down

0 comments on commit c085ea1

Please sign in to comment.