Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/Segment/Utilities/JSON.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public enum JSON: Equatable {
}

// handle swift types
case nil:
case Optional<Any>.none:
self = .null
case let url as URL:
self = .string(url.absoluteString)
Expand Down
2 changes: 1 addition & 1 deletion Tests/Segment-Tests/JSON_Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class JSONTests: XCTestCase {
}

func testJSONNil() throws {
let traits = try JSON(["type": NSNull(), "preferences": ["bwack"]])
let traits = try JSON(["type": NSNull(), "preferences": ["bwack"], "key": nil])
let encoder = JSONEncoder()
encoder.outputFormatting = .prettyPrinted

Expand Down