fix: error when first open workspace
This commit is contained in:
1 parent
0d7da8d432
commit
1ae6c348a8
1 file changed
+3
-3
@@ -384,11 +384,11 @@ export default class Explorer extends Component<ExplorerProps> {
|
|||||||
const { onOpenTree, onDeleteTree, workdir } = this.props;
|
const { onOpenTree, onDeleteTree, workdir } = this.props;
|
||||||
|
|
||||||
const root = this.state.root;
|
const root = this.state.root;
|
||||||
if (!workdir || workdir === "" ) {
|
if (!workdir || workdir === "" || !root) {
|
||||||
return (<div>请打开workspace.json文件</div>);
|
return `请打开workspace.json文件`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const nodes = root ? [root.getRenderData()] : [];
|
const nodes = [root.getRenderData()];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
Reference in new issue
Block a user