diff --git a/site/theme/template/IconDisplay/IconPicSearcher.tsx b/site/theme/template/IconDisplay/IconPicSearcher.tsx index c44cf1d7fc7a..12a441471b0b 100644 --- a/site/theme/template/IconDisplay/IconPicSearcher.tsx +++ b/site/theme/template/IconDisplay/IconPicSearcher.tsx @@ -94,8 +94,8 @@ class PicSearcher extends Component { fileList: [], icons: [], })); - if (!window.localStorage.getItem('disableIconTip')) { - window.localStorage.setItem('disableIconTip', 'true'); + if (localStorage && !localStorage.getItem('disableIconTip')) { + localStorage.setItem('disableIconTip', 'true'); } }; @@ -116,7 +116,7 @@ class PicSearcher extends Component {