Skip to content

Commit 2365228

Browse files
committedMay 17, 2020
fix: CSidebarNavDropdown: place useLocation hook in try/catch block
1 parent bd0903a commit 2365228

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎src/template/CSidebarNavDropdown.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ const CSidebarNavDropdown = props => {
4545

4646
const { dropdownMode } = useContext(Context)
4747

48-
const path = useLocation().pathname
48+
let path = ''
49+
try {
50+
path = useLocation().pathname
51+
} catch (e) {}
52+
4953
useMemo(()=>{
5054
if (dropdownMode === 'close') {
5155
setIsOpen(false)

0 commit comments

Comments
 (0)
Please sign in to comment.