Skip to content

Misc exception fixes based on Mothership reports#1872

Merged
labkey-susanh merged 5 commits intodevelopfrom
fb_miscExceptionFixes_2511
Oct 22, 2025
Merged

Misc exception fixes based on Mothership reports#1872
labkey-susanh merged 5 commits intodevelopfrom
fb_miscExceptionFixes_2511

Conversation

@labkey-susanh
Copy link
Copy Markdown
Contributor

@labkey-susanh labkey-susanh commented Oct 21, 2025

Rationale

We've gotten various exception reports for null-like values. They seem like rare cases (or cases that I can't see how they would happen), but they are easy enough to protect against.

Related Pull Requests

Changes

  • Add some protections for undefined values

@labkey-susanh labkey-susanh requested a review from cnathe October 21, 2025 13:40
permissionCheck: 'all' | 'any' = 'all'
): boolean {
return checkPermissions(user.isAdmin, user.permissionsList, perms, checkIsAdmin, permissionCheck);
return checkPermissions(user?.isAdmin, user?.permissionsList, perms, checkIsAdmin, permissionCheck);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: I believe that if user is undefined, this will end up returning false via checkPermissions, but would it make sense to just check for if (!user) return false; at the beginning?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it is handled gracefully downstream, I'm going to leave this as is.

@labkey-susanh labkey-susanh merged commit e7fc128 into develop Oct 22, 2025
3 checks passed
@labkey-susanh labkey-susanh deleted the fb_miscExceptionFixes_2511 branch October 22, 2025 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants