Skip to content

Commit 4b79e95

Browse files
committed
chore: improve placeholder owner, type, and name handling logic
1 parent f06cac6 commit 4b79e95

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/pro/cloudnode/smp/bankaccounts/integrations/PAPIIntegration.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ yield switch (args[1]) {
6363
default -> Account.get(Account.Tag.from(args[1])).map(value -> String.valueOf(value.balance)).orElse(null);
6464
};
6565
}
66-
case "owner" -> args.length < 2 ? null : Account.get(Account.Tag.from(args[1])).map(value -> value.owner.getName()).orElse(null);
67-
case "type" -> args.length < 2 ? null : Account.get(Account.Tag.from(args[1])).map(value -> value.type.getName()).orElse(null);
68-
case "name" -> args.length < 2 ? null : Account.get(Account.Tag.from(args[1])).map(value -> value.name).orElse(null);
66+
case "owner" -> args.length != 2 ? null : Account.get(Account.Tag.from(args[1])).map(value -> value.owner.getName()).orElse(null);
67+
case "type" -> args.length != 2 ? null : Account.get(Account.Tag.from(args[1])).map(value -> value.type.getName()).orElse(null);
68+
case "name" -> args.length != 2 ? null : Account.get(Account.Tag.from(args[1])).map(value -> value.name).orElse(null);
6969
default -> null;
7070
};
7171
}

0 commit comments

Comments
 (0)