Я получаю сообщение об ошибке по этому коду ниже:
HashMap map = new HashMap();
map.put("driver", userId);
map.put("customer", customerId);
map.put("rating", 0);
map.put("timestamp", getCurrentTimestamp());
map.put("destination", destination);
map.put("location/from/lat", pickupLatLng.latitude);
map.put("location/from/lng", pickupLatLng.longitude);
map.put("location/to/lat", destinationLatLng.latitude);
map.put("location/to/lng", destinationLatLng.longitude);
map.put("distance", rideDistance);
historyRef.child(requestId).updateChildren(map);
Они сказали добавить:
do if (pickupLatLng.latitude! = Null && pickupLatLng.longitude!= null && destinationLatLng.latitude! = null && destinationLatLng.longitude! = null) перед созданием hashMap или для каждой широты и долготы.
Но когда я пытаюсь это сделать, я получаю следующую ошибку:оператор! = не может быть применен к double, null
Может кто-нибудь помочь мне, пожалуйста?