Merge pull request #306586 from microsoft/copilot/fix-null-reference-error

Fix null crash in task schema fixReferences
This commit is contained in:
Bryan Chen
2026-03-31 18:16:33 -07:00
committed by GitHub

View File

@@ -28,7 +28,7 @@ function fixReferences(literal: Record<string, unknown> | unknown[]) {
}
Object.getOwnPropertyNames(literal).forEach(property => {
const value = literal[property];
if (Array.isArray(value) || typeof value === 'object') {
if (Array.isArray(value) || (typeof value === 'object' && value !== null)) {
fixReferences(value as Record<string, unknown>);
}
});