fix: error when first open workspace

This commit is contained in:
duanhongbo committed 2020-12-03 19:23:16 +08:00
1 parent 0d7da8d432
commit 1ae6c348a8
1 file changed
+3 -3
+3 -3
View File
@@ -384,11 +384,11 @@ export default class Explorer extends Component<ExplorerProps> {
const { onOpenTree, onDeleteTree, workdir } = this.props;
const root = this.state.root;
if (!workdir || workdir === "" ) {
return (<div>请打开workspace.json文件</div>);
if (!workdir || workdir === "" || !root) {
return `请打开workspace.json文件`;
}
const nodes = root ? [root.getRenderData()] : [];
const nodes = [root.getRenderData()];
return (
<div>