Skip to content

Commit 808425f

Browse files
committed
fix: bugfix
Signed-off-by: Uroš Marolt <uros@marolt.me>
1 parent faeeceb commit 808425f

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

services/libs/common/src/member.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,17 @@ export async function setAttributesDefaultValues(
3333
;(attributes[attributeName] as any).default =
3434
attributes[attributeName][highestPriorityPlatform]
3535
} else {
36-
delete attributes[attributeName]
36+
// Only delete if there is no existing non-empty default value.
37+
// An attribute with only a `default` key and no platform-specific keys
38+
// has no source platform to derive from, but its value should be preserved.
39+
const existingDefault = (attributes[attributeName] as any).default
40+
if (
41+
existingDefault === undefined ||
42+
existingDefault === null ||
43+
String(existingDefault).trim().length === 0
44+
) {
45+
delete attributes[attributeName]
46+
}
3747
}
3848
}
3949

0 commit comments

Comments
 (0)