File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
src/main/java/de/rwth/idsg/steve/service Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -148,6 +148,9 @@ public void ocppTransactionEnded(OcppTransactionEnded event) {
148148 log .debug ("Processing: {}" , event );
149149
150150 var transaction = transactionService .getTransaction (event .getParams ().getTransactionId ());
151+ if (transaction == null ) {
152+ return ;
153+ }
151154
152155 var user = userService .getUserForMail (transaction .getOcppIdTag (), NotificationFeature .OcppTransactionEnded );
153156 if (user == null ) {
Original file line number Diff line number Diff line change 3535import org .jetbrains .annotations .Nullable ;
3636import org .joda .time .DateTime ;
3737import org .springframework .stereotype .Service ;
38+ import org .springframework .util .CollectionUtils ;
3839
3940import java .io .Writer ;
4041import java .util .Comparator ;
@@ -77,7 +78,11 @@ public Transaction getTransaction(int transactionPk) {
7778 form .setReturnCSV (false );
7879 form .setType (TransactionQueryForm .QueryType .ALL );
7980
80- return transactionRepository .getTransactions (form ).getFirst ();
81+ List <Transaction > transactions = transactionRepository .getTransactions (form );
82+ if (CollectionUtils .isEmpty (transactions )) {
83+ return null ;
84+ }
85+ return transactions .getFirst ();
8186 }
8287
8388 public Transaction getLatestActiveTransaction (String chargeBoxId , Integer connectorId ) {
You can’t perform that action at this time.
0 commit comments