Skip to content

Commit

Permalink
Try catch added at call to minifyCriteria in server.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Houwie7000 committed Jan 19, 2025
1 parent 39ce2fa commit a7c7432
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Framework/Backend/websocket/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,12 @@ class WebSocket {
// 2. Check if its message filter (no auth required)
if (parsed.getCommand() == 'filter' && parsed.getPayload()) {
client.filter = new Function(`return ${parsed.getPayload()}`)();
const criterias = minifyCriteria(client.filter(message, true));
let criterias;
try {
criterias = minifyCriteria(client.filter(message, true));
} catch {
this.logger.errorMessage('Invalid payload criteria received at onmessage()');

Check warning on line 154 in Framework/Backend/websocket/server.js

View check run for this annotation

Codecov / codecov/patch

Framework/Backend/websocket/server.js#L154

Added line #L154 was not covered by tests
}
if (criterias != false) {
this.logger.debugMessage(`New live filter applied: ${JSON.stringify(criterias)}`);
}
Expand Down

0 comments on commit a7c7432

Please sign in to comment.