client: show error dialog when unable to load client

This commit is contained in:
Adam
2019-03-23 16:55:31 -04:00
parent b8503e0326
commit 98838fd751
2 changed files with 9 additions and 3 deletions

View File

@@ -211,7 +211,6 @@ public class ClientLoader
}
log.error("Error loading RS!", e);
System.exit(-1);
return null;
}
}

View File

@@ -52,6 +52,7 @@ import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import static javax.swing.JOptionPane.ERROR_MESSAGE;
import static javax.swing.JOptionPane.INFORMATION_MESSAGE;
import javax.swing.JPanel;
import javax.swing.JRootPane;
@@ -510,8 +511,14 @@ public class ClientUI
});
// Show out of date dialog if needed
final boolean isOutdated = !(client instanceof Client);
if (isOutdated)
if (client == null)
{
SwingUtilities.invokeLater(() -> JOptionPane.showMessageDialog(frame,
"Error loading client! Check your logs for more details.",
"Unable to load client",
ERROR_MESSAGE));
}
else if (!(client instanceof Client))
{
SwingUtilities.invokeLater(() -> JOptionPane.showMessageDialog(frame,
"RuneLite has not yet been updated to work with the latest\n"