diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-10-04 15:43:31 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-10-09 16:38:02 +0200 |
| commit | e1fd11775c7d275dd57d7d9202e88ac5173bbeef (patch) | |
| tree | 6ae817d4a175b5ad3027541133f88590200558f9 /libdino/src/service/history_sync.vala | |
| parent | 2c445501a4dc56c4a814f457a4669d79ebce0a57 (diff) | |
| download | dino-e1fd11775c7d275dd57d7d9202e88ac5173bbeef.tar.gz | |
Check XmppStream against null
Most of the calls to stream_interactor.get_stream(account) were already
doing null checks, but there were still some missing.
Diffstat (limited to 'libdino/src/service/history_sync.vala')
| -rw-r--r-- | libdino/src/service/history_sync.vala | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libdino/src/service/history_sync.vala b/libdino/src/service/history_sync.vala index d883fd79..ef7c65e6 100644 --- a/libdino/src/service/history_sync.vala +++ b/libdino/src/service/history_sync.vala @@ -366,7 +366,10 @@ public class Dino.HistorySync { * prev_page_result: null if this is the first page request **/ private async PageRequestResult get_mam_page(Account account, Xmpp.MessageArchiveManagement.V2.MamQueryParams query_params, PageRequestResult? prev_page_result, Cancellable? cancellable = null) { - XmppStream stream = stream_interactor.get_stream(account); + XmppStream? stream = stream_interactor.get_stream(account); + if (stream == null) { + return new PageRequestResult.with_result(PageResult.Error); + } Xmpp.MessageArchiveManagement.QueryResult query_result = null; if (prev_page_result == null) { query_result = yield Xmpp.MessageArchiveManagement.V2.query_archive(stream, query_params, cancellable); @@ -592,5 +595,9 @@ public class Dino.HistorySync { this.query_result = query_result; this.stanzas = stanzas; } + + public PageRequestResult.with_result(PageResult page_result) { + this.page_result = page_result; + } } } |
