Skip to content

Commit

Permalink
Guard setSecurityAlgorithm from pending connections (#1302)
Browse files Browse the repository at this point in the history
Guard race condition to semver before it's ready
  • Loading branch information
tresf authored Nov 6, 2024
1 parent cb91ba2 commit cdab545
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/qz-tray.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit cdab545

Please sign in to comment.