diff --git a/cockatrice/src/interface/widgets/tabs/abstract_tab_deck_editor.cpp b/cockatrice/src/interface/widgets/tabs/abstract_tab_deck_editor.cpp index c03ffb114..a6aa81b5a 100644 --- a/cockatrice/src/interface/widgets/tabs/abstract_tab_deck_editor.cpp +++ b/cockatrice/src/interface/widgets/tabs/abstract_tab_deck_editor.cpp @@ -388,7 +388,8 @@ bool AbstractTabDeckEditor::actSaveDeckAs() */ void AbstractTabDeckEditor::actShareDeck() { - if (tabSupervisor->getClient()->getStatus() != StatusLoggedIn) { + AbstractClient *client = tabSupervisor->getServerClient(); + if (client->getStatus() != StatusLoggedIn) { QMessageBox::information(this, tr("Share deck"), tr("You must be connected to the server to share a deck.")); return; } @@ -399,7 +400,7 @@ void AbstractTabDeckEditor::actShareDeck() return; } - DlgShareDeck shareDialog(tabSupervisor->getClient(), deck, this); + DlgShareDeck shareDialog(client, deck, this); shareDialog.exec(); } diff --git a/cockatrice/src/interface/widgets/tabs/tab_supervisor.h b/cockatrice/src/interface/widgets/tabs/tab_supervisor.h index adde7f971..11f6ba630 100644 --- a/cockatrice/src/interface/widgets/tabs/tab_supervisor.h +++ b/cockatrice/src/interface/widgets/tabs/tab_supervisor.h @@ -152,6 +152,10 @@ public: return userInfo; } [[nodiscard]] AbstractClient *getClient() const; + [[nodiscard]] AbstractClient *getServerClient() const + { + return client; + } [[nodiscard]] UserListManager *getUserListManager() const { return userListManager;