Skip to content
Open
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
5 changes: 4 additions & 1 deletion IPAPI/IPAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ open class IPAPI {
fileprivate static let endpointUrl = "http://ip-api.com/json"

open class func location(_ session: URLSession) -> Observable<IPGeoData?> {
let url = URL(string: endpointUrl)!
guard let url: URL = URL(string: endpointUrl) else {
return Observable<IPGeoData?>.just(nil)
}

return session.rx
.json(url: url)
.observeOn(MainScheduler.asyncInstance)
Expand Down