diff --git a/src/controllers/proxyManagementController.js b/src/controllers/proxyManagementController.js index 2241804..584703f 100644 --- a/src/controllers/proxyManagementController.js +++ b/src/controllers/proxyManagementController.js @@ -35,6 +35,9 @@ const getUserConnectionsStatus = async (req, res) => { try { const { shortcode } = req.params; const cache = req.app.get('cache'); + if (!cache.has(`${shortcode}-userConnections`)) { + return res.status(404).json({ message: `No ${shortcode}-userConnections cache exists` }); + } const userConnections = cache.get(`${shortcode}-userConnections`); console.log(Object.fromEntries(userConnections));