Skip to content

Commit

Permalink
fix: Fixed undefined urlcode on start session
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed Nov 2, 2022
1 parent 7a1ead3 commit b122a2a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/controller/sessionController.js
Expand Up @@ -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 });
Expand Down

0 comments on commit b122a2a

Please sign in to comment.