From cac9696eab3fcfc154cbd0b5f9696c72722202db Mon Sep 17 00:00:00 2001 From: langerhans Date: Sat, 30 Jan 2016 19:24:53 +0100 Subject: [PATCH] Fix possible crash on OS X --- src/main/java/org/multibit/MultiBit.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/multibit/MultiBit.java b/src/main/java/org/multibit/MultiBit.java index 130de1429..a2cc16dca 100644 --- a/src/main/java/org/multibit/MultiBit.java +++ b/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.