@@ -74,20 +74,19 @@ private fun jsonToSkins(jsonArray: JSONArray): List<Skin> {
7474private fun jsonToStatsDetails (json : JSONObject ): StatsDetails {
7575 try {
7676 return StatsDetails (
77- speed = json.getInt(" speed" ),
78- accuracy = json.getInt(" accuracy" ),
79- antiAir = json.getInt(" antiair" ),
80- antiSub = json.getInt(" antisubmarineWarfare" ),
81- armor = json.getString(" armor" ),
82- aviation = json.getInt(" aviation" ),
83- evasion = json.getInt(" evasion" ),
84- firepower = json.getInt(" firepower" ),
85- health = json.getInt(" health" ),
86- luck = json.getInt(" luck" ),
87- // FIXME: it should be defined
77+ speed = json.optInt(" speed" ),
78+ accuracy = json.optInt(" accuracy" ),
79+ antiAir = json.optInt(" antiair" ),
80+ antiSub = json.optInt(" antisubmarineWarfare" ),
81+ armor = json.optString(" armor" ),
82+ aviation = json.optInt(" aviation" ),
83+ evasion = json.optInt(" evasion" ),
84+ firepower = json.optInt(" firepower" ),
85+ health = json.optInt(" health" ),
86+ luck = json.optInt(" luck" ),
8887 oil = json.optInt(" oilConsumption" ),
89- reload = json.getInt (" reload" ),
90- torpedo = json.getInt (" torpedo" )
88+ reload = json.optInt (" reload" ),
89+ torpedo = json.optInt (" torpedo" )
9190 )
9291 } catch (e: JSONException ) {
9392 throw e
0 commit comments