diff --git a/src/controllers/beneficiary.controller.js b/src/controllers/beneficiary.controller.js index c079c64..abaea38 100644 --- a/src/controllers/beneficiary.controller.js +++ b/src/controllers/beneficiary.controller.js @@ -121,7 +121,7 @@ async function getIfscDetails(req, res) { try { const query = 'SELECT * FROM ifsc_details WHERE ifsc_code = $1'; const result = await db.query(query, [ifscCode]); - if (!result.rows) { + if (result.rows?.length === 0) { res.status(404).json({ error: 'NOT_FOUND' }); return; }