Skip to content

Commit b75fd7b

Browse files
committed
fix: Improve null value handling in CONFIG and Processor
- Add explicit null value handling in Processor.processObject - Ensure CONFIG.get properly handles null values while maintaining default value behavior - Fix edge case where null values were being converted to undefined - Maintain backward compatibility with existing CONFIG behavior
1 parent 7d80996 commit b75fd7b

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/CONFIG.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,12 @@ export class CONFIG extends InheritClass implements ICONFIG {
7272
logger.debug("No config value for: " + name);
7373
_value = _default;
7474
}
75-
return Processor.processObject(_value) || _default;
75+
const processedValue = Processor.processObject(_value);
76+
// Special handling for null values
77+
if (_value === null && processedValue === null) {
78+
return null;
79+
}
80+
return processedValue || _default;
7681
}
7782

7883
private static _instance:CONFIG;

src/Processor.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ export class Processor extends InheritClass implements IProcessor {
6565
}
6666

6767
processObject(obj: any, component: IComponent | null = null): any {
68+
// If obj is null or undefined, return it as is
69+
if (obj === null || obj === undefined) {
70+
return obj;
71+
}
72+
6873
let __instance__: IProcessor | undefined = (component === null) ? (this) : (component.processorHandler);
6974
if (typeof __instance__ === "undefined") {
7075
__instance__ = new Processor({ component });

0 commit comments

Comments
 (0)