Skip to content

Commit

Permalink
fix: add type checks to the set_id
Browse files Browse the repository at this point in the history
  • Loading branch information
arifBurakDemiray authored Nov 7, 2024
1 parent 544aec5 commit 2861fc5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/countly.js
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ Countly.Bulk = Bulk;
* */
Countly.set_id = function(newId) {
cc.log(cc.logLevelEnums.INFO, `set_id, Changing the device ID to: [${newId}]`);
if (newId === null || newId === "" || newId === undefined) {
if (newId === null || newId === undefined || typeof newId === "string" || newId === "") {
cc.log(cc.logLevelEnums.WARNING, "set_id, The provided device is not a valid ID");
return;
}
Expand Down

0 comments on commit 2861fc5

Please sign in to comment.