Permalink
Browse files

Fix possible crash on OS X

  • Loading branch information...
1 parent 7862a93 commit cac9696eab3fcfc154cbd0b5f9696c72722202db @langerhans committed Jan 30, 2016
Showing with 7 additions and 5 deletions.
  1. +7 −5 src/main/java/org/multibit/MultiBit.java
@@ -614,11 +614,13 @@ public void run() {
}
// Upgrade path from cryptsy
- if (bitcoinController.getModel().getUserPreference(ExchangeModel.TICKER_FIRST_ROW_EXCHANGE).equals(ExchangeData.CRYPTS_EXCHANGE_NAME)) {
- bitcoinController.getModel().setUserPreference(ExchangeModel.TICKER_FIRST_ROW_EXCHANGE, ExchangeData.POLONIEX_EXCHANGE_NAME);
- }
- if (bitcoinController.getModel().getUserPreference(ExchangeModel.TICKER_SECOND_ROW_EXCHANGE).equals(ExchangeData.CRYPTS_EXCHANGE_NAME)) {
- bitcoinController.getModel().setUserPreference(ExchangeModel.TICKER_SECOND_ROW_EXCHANGE, ExchangeData.POLONIEX_EXCHANGE_NAME);
+ if (bitcoinController != null && bitcoinController.getModel() != null) { // Mac sometimes isn't ready yet...
+ if (ExchangeData.CRYPTS_EXCHANGE_NAME.equals(bitcoinController.getModel().getUserPreference(ExchangeModel.TICKER_FIRST_ROW_EXCHANGE))) {
+ bitcoinController.getModel().setUserPreference(ExchangeModel.TICKER_FIRST_ROW_EXCHANGE, ExchangeData.POLONIEX_EXCHANGE_NAME);
+ }
+ if (ExchangeData.CRYPTS_EXCHANGE_NAME.equals(bitcoinController.getModel().getUserPreference(ExchangeModel.TICKER_SECOND_ROW_EXCHANGE))) {
+ bitcoinController.getModel().setUserPreference(ExchangeModel.TICKER_SECOND_ROW_EXCHANGE, ExchangeData.POLONIEX_EXCHANGE_NAME);
+ }
}
} catch (Exception e) {
// An odd unrecoverable error occurred.

0 comments on commit cac9696

Please sign in to comment.