File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,6 @@ extension NSCharacterSet {
44
44
extension String {
45
45
func toArray( ) throws -> [ AnyObject ] {
46
46
guard let stringData = dataUsingEncoding ( NSUTF8StringEncoding, allowLossyConversion: false ) else { return [ ] }
47
-
48
47
guard let array = try NSJSONSerialization . JSONObjectWithData ( stringData, options: . MutableContainers) as? [ AnyObject ] else {
49
48
throw JSONError . notArray
50
49
}
@@ -53,8 +52,7 @@ extension String {
53
52
}
54
53
55
54
func toNSDictionary( ) throws -> NSDictionary {
56
- let binData = dataUsingEncoding ( NSUTF8StringEncoding, allowLossyConversion: false ) !
57
-
55
+ guard let binData = dataUsingEncoding ( NSUTF8StringEncoding, allowLossyConversion: false ) else { return [ : ] }
58
56
guard let json = try NSJSONSerialization . JSONObjectWithData ( binData, options: . AllowFragments) as? NSDictionary else {
59
57
throw JSONError . notNSDictionary
60
58
}
You can’t perform that action at this time.
0 commit comments