close #350 catch error may caused by checkout feature

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent 8649ae2752
commit 58504e7d77

View File

@@ -977,10 +977,19 @@ export class Replayer {
for (const attributeName in mutation.attributes) {
if (typeof attributeName === 'string') {
const value = mutation.attributes[attributeName];
if (value !== null) {
((target as Node) as Element).setAttribute(attributeName, value);
} else {
((target as Node) as Element).removeAttribute(attributeName);
try {
if (value !== null) {
((target as Node) as Element).setAttribute(attributeName, value);
} else {
((target as Node) as Element).removeAttribute(attributeName);
}
} catch (error) {
if (this.config.showWarning) {
console.warn(
'An error occurred may due to the checkout feature.',
error,
);
}
}
}
}