Skip to content

Commit 2935daf

Browse files
committed
Add nullcheck for test
1 parent 5a894f7 commit 2935daf

File tree

1 file changed

+7
-0
lines changed
  • packages/app/src/app/components/Preview/DevTools/Tests

1 file changed

+7
-0
lines changed

packages/app/src/app/components/Preview/DevTools/Tests/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,13 @@ class Tests extends React.Component<Props, State> {
233233

234234
this.setState(
235235
immer(this.state, state => {
236+
if (!state.files[data.path]) {
237+
state.files[data.path] = {
238+
tests: {},
239+
fileName: data.path,
240+
};
241+
}
242+
236243
const currentTest =
237244
state.files[test.path].tests[testName.join('||||')];
238245
if (!currentTest) {

0 commit comments

Comments
 (0)