diff --git a/dataModule/src/main/java/com/aneonex/bitcoinchecker/datamodule/model/market/Gemini.kt b/dataModule/src/main/java/com/aneonex/bitcoinchecker/datamodule/model/market/Gemini.kt index 5756468e..8d4b8cbb 100644 --- a/dataModule/src/main/java/com/aneonex/bitcoinchecker/datamodule/model/market/Gemini.kt +++ b/dataModule/src/main/java/com/aneonex/bitcoinchecker/datamodule/model/market/Gemini.kt @@ -39,11 +39,11 @@ class Gemini : Market(NAME, TTS_NAME, CURRENCY_PAIRS) { //We could do something like take the average of the last Y prices //But I will just take the average of the last bid and asking price val bidsArray = jsonObject.getJSONArray("bids") - if (bidsArray != null && bidsArray.length() > 0) { + if (bidsArray.length() > 0) { ticker.bid = bidsArray.getJSONObject(0).getDouble("price") } val asksArray = jsonObject.getJSONArray("asks") - if (asksArray != null && asksArray.length() > 0) { + if (asksArray.length() > 0) { ticker.ask = asksArray.getJSONObject(0).getDouble("price") } if (ticker.bid != Ticker.NO_DATA.toDouble() && ticker.ask != Ticker.NO_DATA.toDouble()) { diff --git a/dataModule/src/main/java/com/aneonex/bitcoinchecker/datamodule/model/market/Kraken.kt b/dataModule/src/main/java/com/aneonex/bitcoinchecker/datamodule/model/market/Kraken.kt index afb8c7a8..c6856ad8 100644 --- a/dataModule/src/main/java/com/aneonex/bitcoinchecker/datamodule/model/market/Kraken.kt +++ b/dataModule/src/main/java/com/aneonex/bitcoinchecker/datamodule/model/market/Kraken.kt @@ -39,7 +39,7 @@ class Kraken : Market(NAME, TTS_NAME, null) { @Throws(Exception::class) private fun getDoubleFromJsonArrayObject(jsonObject: JSONObject, arrayKey: String): Double { val jsonArray = jsonObject.getJSONArray(arrayKey) - return if (jsonArray != null && jsonArray.length() > 0) jsonArray.getDouble(0) else 0.0 + return if (jsonArray.length() > 0) jsonArray.getDouble(0) else 0.0 } // ====================