Skip to content

Commit cdab545

Browse files
authored
Guard setSecurityAlgorithm from pending connections (#1302)
Guard race condition to semver before it's ready
1 parent cb91ba2 commit cdab545

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

js/qz-tray.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,8 @@ var qz = (function() {
963963
/** Check if QZ version supports chosen algorithm */
964964
algorithm: function(quiet) {
965965
//if not connected yet we will assume compatibility exists for the time being
966-
if (_qz.tools.isActive()) {
966+
//check semver to guard race condition for pending connections
967+
if (_qz.tools.isActive() && _qz.websocket.connection.semver) {
967968
if (_qz.tools.isVersion(2, 0)) {
968969
if (!quiet) {
969970
_qz.log.warn("Connected to an older version of QZ, alternate signature algorithms are not supported");

0 commit comments

Comments
 (0)