Fix null point in approvvigionamento linee
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
|
||||
public class NoOrdersScheduledException extends Exception {
|
||||
|
||||
public NoOrdersScheduledException() {
|
||||
super(UtilityResources.getString(R.string.no_orders_scheduled));
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import com.annimon.stream.Stream;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.exception.NoOrdersScheduledException;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dto.ProdFabbisognoLineeProdDTO;
|
||||
@@ -29,13 +30,17 @@ public class ProdFabbisognoLineeProdViewModel {
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
this.mProdFabbisognoLineeProdRESTConsumer.loadFabbisogno(startDate, endDate, codMdep, jtbFasi -> {
|
||||
if (jtbFasi != null) Stream.of(jtbFasi)
|
||||
.forEach(x -> x
|
||||
.setDataInizio(startDate)
|
||||
.setDataFine(endDate));
|
||||
if (jtbFasi != null){
|
||||
Stream.of(jtbFasi)
|
||||
.forEach(x -> x
|
||||
.setDataInizio(startDate)
|
||||
.setDataFine(endDate));
|
||||
|
||||
this.sendOnLoadingEnded();
|
||||
onComplete.run(jtbFasi);
|
||||
this.sendOnLoadingEnded();
|
||||
onComplete.run(jtbFasi);
|
||||
}else{
|
||||
this.mListener.onError(new NoOrdersScheduledException());
|
||||
}
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user