handle exception while attempting to open an existing wallet
This commit is contained in:
parent
003d671c25
commit
a478a79e8b
@ -150,14 +150,22 @@ try {
|
||||
menuBar->EnableTop(1, false); //disable edit menu.
|
||||
// child controls
|
||||
m_LastUsedSqlite.Assign(singletonApp->pConfig->Read(wxT("/Wallet/LastUsed"), wxT("")));
|
||||
if (!m_LastUsedSqlite.IsOk() || !m_LastUsedSqlite.HasName() || !m_LastUsedSqlite.HasExt()) {
|
||||
m_panel = new welcome_to_rhocoin(this); //Owner is "this", via the base class wxFrame. m_panel is a
|
||||
// non owning pointer in the derived class that duplicates the owning pointer in the base class.
|
||||
wxPanel* panel{ nullptr };
|
||||
try {
|
||||
if (m_LastUsedSqlite.IsOk())
|
||||
{ //Try to load an existing file.
|
||||
panel = new display_wallet(this, m_LastUsedSqlite);
|
||||
}
|
||||
else {
|
||||
display_wallet* panel = new display_wallet(this, m_LastUsedSqlite);
|
||||
m_panel = panel;
|
||||
panel = new welcome_to_rhocoin(this);
|
||||
}
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
queue_error_message(e.what());
|
||||
panel = new welcome_to_rhocoin(this); //Owner is "this", via the base class wxFrame. m_panel is a
|
||||
// non owning pointer in the derived class that duplicates the owning pointer in the base class.
|
||||
}
|
||||
m_panel = panel;
|
||||
this->RestorePositionFromConfig(ClientToWindowSize(m_panel->GetBestSize()));
|
||||
SetClientSize(GetClientSize());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user