Fix Experiments embed patches

This commit is contained in:
Nuckyz 2025-07-14 17:07:43 -03:00 committed by dorkbutt
parent aa52e1a42b
commit 2a52efbd97
No known key found for this signature in database

View file

@ -116,11 +116,19 @@ export default definePlugin({
}, },
// Fix some tricky experiments name causing a client crash // Fix some tricky experiments name causing a client crash
{ {
match: /.getRegisteredExperiments\(\)(?<=(\i)=.+?).+?if\(null==(\i)(?=\)return null;)/, match: /.getExperimentBucketName.+?if\(null==(\i)\|\|null==\i(?=\)return null;)/,
replace: "$&||!Object.hasOwn($1,$2)" replace: "$&||({})[$1]!=null"
} }
] ]
}, },
// Fix another function which cases crashes with tricky experiment names and the experiment embed
{
find: "}getServerAssignment(",
replacement: {
match: /}getServerAssignment\((\i),\i,\i\){/,
replace: "$&if($1==null)return;"
}
}
], ],
start: () => !BugReporterExperiment.getCurrentConfig().hasBugReporterAccess && enableStyle(hideBugReport), start: () => !BugReporterExperiment.getCurrentConfig().hasBugReporterAccess && enableStyle(hideBugReport),