Skip to content

Commit

Permalink
Fix issues with cancelled transactions which would still print the me…
Browse files Browse the repository at this point in the history
…ssage
  • Loading branch information
Phoenix616 committed Jan 5, 2025
1 parent 66c3bfe commit 481f630
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public abstract class EconomyAdapter implements Listener {
* @param event The CurrencyTransferEvent to process
*/
protected void processTransfer(CurrencyTransferEvent event) {
if (event.wasHandled()) {
if (event.wasHandled() || event.getTransactionEvent() == null || event.getTransactionEvent().isCancelled()) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
* @author Acrobot
*/
public class TransactionMessageSender implements Listener {
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
@EventHandler(priority = EventPriority.MONITOR)
public static void onCurrencyTransfer(CurrencyTransferEvent event) {
if (event.getTransactionEvent() == null) {
if (event.getTransactionEvent() == null || !event.wasHandled() || event.getTransactionEvent().isCancelled()) {
return;
}
if (event.getTransactionEvent().getTransactionType() == TransactionEvent.TransactionType.BUY) {
Expand Down

0 comments on commit 481f630

Please sign in to comment.