Skip to content

Commit 5484915

Browse files
committed
fix url verify
1 parent 5efcd05 commit 5484915

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

SwiftPamphletApp/InfoOrganizer/Info/InfoListView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct InfoListView: View {
2929
ToolbarItem(placement: .navigation) {
3030
Picker("分类", selection: $filterCate) {
3131
HStack {
32-
Image(systemName: "books.vertical")
32+
// Image(systemName: "books.vertical")
3333
Text("全部")
3434
}
3535
.tag("")

SwiftPamphletApp/ViewComponet/ViewComponet.swift

+4-2
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,10 @@ struct WebUIView: NSViewRepresentable {
150150
let host = URL(string: baseURLStr)?.host ?? ""
151151
nsView.loadHTMLString(html, baseURL: URL(string: "https://\(host)"))
152152
} else {
153-
let r = URLRequest(url: URL(string: urlStr)!)
154-
nsView.load(r)
153+
if let url = URL(string: urlStr) {
154+
let r = URLRequest(url: url)
155+
nsView.load(r)
156+
}
155157
}
156158
}
157159

0 commit comments

Comments
 (0)