BugFix Picking da ordine: errore in caso di lista commesse vuota
This commit is contained in:
parent
7678ce1a50
commit
5eac3f14cc
@ -915,8 +915,6 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void initJtbComtCache(Runnable onComplete) {
|
private void initJtbComtCache(Runnable onComplete) {
|
||||||
if (this.mViewModel.getOrderList().getValue() == null) {
|
if (this.mViewModel.getOrderList().getValue() == null) {
|
||||||
this.jtbComtCache = new ArrayList<>();
|
this.jtbComtCache = new ArrayList<>();
|
||||||
@ -925,8 +923,15 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
|||||||
}
|
}
|
||||||
var jtbComts = Stream.of(Objects.requireNonNull(this.mViewModel.getOrderList().getValue()))
|
var jtbComts = Stream.of(Objects.requireNonNull(this.mViewModel.getOrderList().getValue()))
|
||||||
.flatMap(x -> Stream.of(x.getCodJcom()))
|
.flatMap(x -> Stream.of(x.getCodJcom()))
|
||||||
|
.distinct().withoutNulls()
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
|
if (jtbComts.isEmpty()) {
|
||||||
|
this.jtbComtCache = new ArrayList<>();
|
||||||
|
onComplete.run();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.mCommessaRESTConsumer.getJtbComts(jtbComts, jtbComtCache -> {
|
this.mCommessaRESTConsumer.getJtbComts(jtbComts, jtbComtCache -> {
|
||||||
this.jtbComtCache = jtbComtCache;
|
this.jtbComtCache = jtbComtCache;
|
||||||
onComplete.run();
|
onComplete.run();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user