214
215 if(resultCode == RESULT_OK){
216 if(requestCode == REQUEST_GALERIA){
217 Uri localImagemSelecionada = data.getData();218 caminhoImagem = localImagemSelecionada.toString();
219
220 if(Build.VERSION.SDK_INT < 28){
This parameter is always used as if it is non-null, but the parameter may be null when the usage occurs.
public void doWork(MyClass myClass) {
// ...
// Dereference without a null check.
myClass.myField = "value";
// ...
}
// ...
MyClass nullable;
// ...
if (condition) nullable = new MyClass();
else nullable = null;
// ...
doWork(nullable); // If nullable is null, we will get an NPE
If you require that the parameter should never be null, consider changing the annotation to @NonNull
or an equivalent annotation to indicate that the method expects the value to be non-null.
If the variable is likely to be null, consider performing a null check before using the variable.