Fix null pointer vari

This commit is contained in:
2025-05-26 18:19:30 +02:00
parent 86632940eb
commit 20783026b8
2 changed files with 4 additions and 2 deletions

View File

@@ -3,6 +3,7 @@ package it.integry.integrywmsnative.gest.prod_recupero_materiale;
import androidx.lifecycle.MutableLiveData;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.ExecutorService;
@@ -66,7 +67,7 @@ public class ProdRecuperoMaterialeViewModel {
this.mExecutorService.execute(() -> {
try {
List<HistoryVersamentoProdULDTO> lastUlVersate = mProdRecuperoMaterialeRESTConsumer.loadLastULVersateSynchronized(mCodJfas);
this.mUlList.postValue(lastUlVersate);
this.mUlList.postValue(lastUlVersate != null ? lastUlVersate : new ArrayList<>());
this.sendOnDataRefreshEnded();
} catch (Exception e) {
this.sendError(e);

View File

@@ -3,6 +3,7 @@ package it.integry.integrywmsnative.gest.prod_rientro_merce.order_list;
import androidx.databinding.ObservableField;
import androidx.lifecycle.MutableLiveData;
import java.util.Comparator;
import java.util.List;
import java.util.Objects;
import java.util.function.Predicate;
@@ -76,7 +77,7 @@ public class ProdRientroMerceOrderListFilterViewModel {
return Objects.requireNonNull(commesseFullList).stream()
.filter(x -> x != null && codJcom.contains(x.getCodJcom()))
.distinct()
.sorted((o1, o2) -> o1.getCodJcom().compareTo(o2.getCodJfas()))
.sorted(Comparator.comparing(JtbComt::getCodJcom))
.collect(Collectors.toUnmodifiableList());
}