From b122a2a2a86e640c1d4e00f97cd3dd8506ac6a2c Mon Sep 17 00:00:00 2001 From: Cleiton Carvalho Date: Wed, 2 Nov 2022 12:42:14 -0300 Subject: [PATCH] fix: Fixed undefined urlcode on start session --- src/controller/sessionController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controller/sessionController.js b/src/controller/sessionController.js index e864812038..4d814a21cd 100644 --- a/src/controller/sessionController.js +++ b/src/controller/sessionController.js @@ -272,7 +272,7 @@ export async function getSessionState(req, res) { try { const { waitQrCode = false } = req.body; const client = req.client; - const qr = client.urlcode ? await QRCode.toDataURL(client.urlcode) : null; + const qr = client?.urlcode != null && client?.urlcode != '' ? await QRCode.toDataURL(client.urlcode) : null; if ((client == null || client.status == null) && !waitQrCode) return res.status(200).json({ status: 'CLOSED', qrcode: null });