Skip to content

Commit

Permalink
Check that window.jQuery an object
Browse files Browse the repository at this point in the history
  • Loading branch information
atoff committed Dec 2, 2023
1 parent 3cab791 commit 0065f24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util/cloneObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function cloneObject<T>(source: T): T {

for (const key in source) {
// @ts-ignore:next-line
if ("jQuery" in window && source[key] instanceof window.jQuery) {
if ("jQuery" in window && window.jQuery && source[key] instanceof window.jQuery) {
temp[key] = source[key];
} else {
temp[key] = cloneObject(source[key]);
Expand Down

0 comments on commit 0065f24

Please sign in to comment.