Skip to content

Commit 2ddade5

Browse files
committed
Update optional value when initialize JSON with object
1 parent b8df454 commit 2ddade5

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

Source/Alamofire-SwiftyJSON.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,10 @@ extension Alamofire.Request {
4545

4646
if error != nil {
4747
responseJSON = SwiftyJSON.JSON.Null(error)
48+
} else if object != nil {
49+
responseJSON = SwiftyJSON.JSON(object: object!)
4850
} else {
49-
if object != nil {
50-
responseJSON = SwiftyJSON.JSON(object: object)
51-
} else {
52-
responseJSON = SwiftyJSON.JSON.Null(nil)
53-
}
51+
responseJSON = SwiftyJSON.JSON.Null(nil)
5452
}
5553

5654
dispatch_async(queue ?? dispatch_get_main_queue(), {

0 commit comments

Comments
 (0)