как решить эту ошибку
java.lang.NullPointerException: Attempt to read from field 'int com.ddu.d_ride_customer.Model.FCMResponce.success' on a null object reference
FCMClient class
public class FCMClient {
private static Retrofit retrofit = null;
public static Retrofit getClient(String baseURL)
{
if(retrofit == null)
{
retrofit = new Retrofit.Builder()
.baseUrl(baseURL)
.addConverterFactory(GsonConverterFactory.create())
.build();
}
return retrofit;
}
}
пример кода, который генерирует ошибку
mService.sendMessage(content)
.enqueue(new Callback<FCMResponce>() {
@Override
public void onResponse(Call<FCMResponce> call, Response<FCMResponce> response) {
if(response.isSuccessful() && response.body()!=null) {
Toast.makeText(Home.this, "Request sent!", Toast.LENGTH_SHORT).show();
}
else
Toast.makeText(Home.this, "Failed", Toast.LENGTH_SHORT).show();
}