From cdab5451f84c934ce1401585daa2ee1231771a06 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Wed, 6 Nov 2024 12:33:21 -0500 Subject: [PATCH] Guard setSecurityAlgorithm from pending connections (#1302) Guard race condition to semver before it's ready --- js/qz-tray.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/qz-tray.js b/js/qz-tray.js index ba51b21d..3dcfb884 100644 --- a/js/qz-tray.js +++ b/js/qz-tray.js @@ -963,7 +963,8 @@ var qz = (function() { /** Check if QZ version supports chosen algorithm */ algorithm: function(quiet) { //if not connected yet we will assume compatibility exists for the time being - if (_qz.tools.isActive()) { + //check semver to guard race condition for pending connections + if (_qz.tools.isActive() && _qz.websocket.connection.semver) { if (_qz.tools.isVersion(2, 0)) { if (!quiet) { _qz.log.warn("Connected to an older version of QZ, alternate signature algorithms are not supported");