[geary/mjog/931-cannot-remove-accounts: 3/5] Application.Client: Fix criticals when opening first new window
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/mjog/931-cannot-remove-accounts: 3/5] Application.Client: Fix criticals when opening first new window
- Date: Thu, 20 Aug 2020 01:39:54 +0000 (UTC)
commit 8f278e3e039457a16fd0feee4c54db0a0ffd456e
Author: Michael Gratton <mike vee net>
Date: Thu Aug 20 11:34:57 2020 +1000
Application.Client: Fix criticals when opening first new window
If there is no existing window, then `current` will be null.
src/client/application/application-client.vala | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/client/application/application-client.vala b/src/client/application/application-client.vala
index 430027282..3585a5a41 100644
--- a/src/client/application/application-client.vala
+++ b/src/client/application/application-client.vala
@@ -1184,11 +1184,14 @@ public class Application.Client : Gtk.Application {
private void on_activate_new_window() {
// If there was an existing active main, select the same
// account/folder/conversation.
+ Geary.Folder? folder = null;
+ Gee.Collection<Geary.App.Conversation>? conversations = null;
MainWindow? current = this.last_active_main_window;
- this.new_window.begin(
- current.selected_folder,
- current.conversation_list_view.copy_selected()
- );
+ if (current != null) {
+ folder = current.selected_folder;
+ conversations = current.conversation_list_view.copy_selected();
+ }
+ this.new_window.begin(folder, conversations);
}
private void on_activate_preferences() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]