Skip to content

Commit d49828a

Browse files
committed
add null check
1 parent 582c58c commit d49828a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/DocsCategoryDropdown/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function DocsCategoryDropdown({ dropdownCategory }) {
4848
}, [isOpen]); // This runs when the dropdown is opened
4949

5050
const sidebar = useDocsSidebar();
51-
const isSelected = sidebar.name ? sidebar.name === dropdownCategory.sidebar : false;
51+
const isSelected = sidebar && sidebar.name && dropdownCategory ? sidebar.name === dropdownCategory.sidebar : false;
5252

5353
return (
5454
<div

0 commit comments

Comments
 (0)