Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit ae3c175

Browse files
Throw error when primary attribute does not exist
1 parent 7ae0fe4 commit ae3c175

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/components/ProfileCard/helper.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ export function getUserPrimaryAttributeDetails(profile, attributeName) {
8181
(a) => a.attribute.name === attributeName
8282
);
8383

84+
if (!detail) {
85+
throw Error(
86+
`Attribute ${attributeName} missing on user with handle ${profile.handle}`
87+
);
88+
}
89+
8490
switch (attributeName) {
8591
case config.PRIMARY_ATTRIBUTES.availability:
8692
return {

0 commit comments

Comments
 (0)