Skip to content

Commit

Permalink
- DisplayViewController: handle nil OCQueryChangeSet.queryResult (sho…
Browse files Browse the repository at this point in the history
…uld fix crash reported in #1245 (comment))
  • Loading branch information
felix-schwarz committed Jul 31, 2023
1 parent abe25cb commit 95522b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ios-sdk
4 changes: 2 additions & 2 deletions ownCloud/Client/Viewer/DisplayViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -749,11 +749,11 @@ class DisplayViewController: UIViewController, Themeable, OCQueryDelegate {
func queryHasChangesAvailable(_ query: OCQuery) {
query.requestChangeSet(withFlags: .onlyResults) { [weak self] (query, changeSet) in
OnMainThread {
Log.log("DisplayViewController.queryHasChangesAvailable: \(changeSet?.queryResult.description ?? "nil") - state: \(String(describing: query.state.rawValue))")
Log.log("DisplayViewController.queryHasChangesAvailable: \(changeSet?.queryResult?.description ?? "nil") - state: \(String(describing: query.state.rawValue))")

switch query.state {
case .idle, .contentsFromCache, .waitingForServerReply:
if let firstItem = changeSet?.queryResult.first {
if let firstItem = changeSet?.queryResult?.first {
self?.item = firstItem
} else {
// No item available
Expand Down

0 comments on commit 95522b0

Please sign in to comment.