Skip to content

Commit

Permalink
Fix error when to view list is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Cay-Zhang authored and yichengchen committed Nov 28, 2023
1 parent 0aaf84e commit c9a3a6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions BilibiliLive/Module/Personal/ToViewViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ struct ToViewData: PlayableData, Codable {
extension WebRequest {
static func requestToView() async throws -> [ToViewData] {
struct Resp: Codable {
var list: [ToViewData]
var list: [ToViewData]?
}
let res: Resp = try await request(url: "https://api.bilibili.com/x/v2/history/toview")
return res.list
return res.list ?? []
}
}

0 comments on commit c9a3a6e

Please sign in to comment.