Skip to content

Commit 23c20ef

Browse files
committed
fix: optional chaining
1 parent 1bb3142 commit 23c20ef

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

server/app.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ Sentry.init({ dsn: config.sentry_dsn });
2626
app.use(
2727
helper.handlerWrapper(async (req, _res, next) => {
2828
if (req.path === '/wallets/batch-create-wallet' && req.method === 'POST') {
29-
if (!req.headers['content-type']?.includes('multipart/form-data')) {
29+
if (
30+
!req.headers['content-type'] ||
31+
!req.headers['content-type'].includes('multipart/form-data')
32+
) {
3033
throw new HttpError(
3134
415,
3235
'Invalid content type. Endpoint only supports multipart/form-data',

server/services/WalletService.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ class WalletService {
5959
try {
6060
await this._session.beginTransaction();
6161

62-
const senderWalletName = body?.sender_wallet;
62+
const senderWalletName = body.sender_wallet;
6363
let senderWallet;
6464
if (senderWalletName) {
6565
senderWallet = await this.getByName(senderWalletName);
6666
}
67-
const defaultTokenAmount = body?.token_transfer_amount_default;
67+
const defaultTokenAmount = body.token_transfer_amount_default;
6868

6969
const walletPromises = [];
7070
let totalAmountToTransfer = 0;

0 commit comments

Comments
 (0)