Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Synthetics] Improve reading user permissions #169601

Merged
merged 4 commits into from
Oct 31, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use optional chaining for loosly typed error object.
  • Loading branch information
awahab07 committed Oct 31, 2023
commit 9d5b3803af58c41870b64c1fcfecfb5ebc32d0d8
2 changes: 1 addition & 1 deletion x-pack/plugins/synthetics/public/hooks/use_capabilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const useCanReadSyntheticsIndex = () => {
resolve({ canRead: true, error: undefined });
},
error: (error: { err: { statusCode: number } }) => {
if (error.err.statusCode >= 400 && error.err.statusCode < 500) {
if (error.err?.statusCode >= 400 && error.err?.statusCode < 500) {
resolve({ canRead: false, error });
} else {
resolve({ canRead: true, error });
Expand Down