diff options
author | Stan Hu <stanhu@gmail.com> | 2019-04-28 17:48:56 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-04-28 17:48:56 +0300 |
commit | 1afa382687e2f896f6d4ead90111dc37604537a5 (patch) | |
tree | 0bb7c8f2829a9643d99b90ea2044239c36918fee /app/assets/javascripts/diffs/workers | |
parent | faf8789b05a4a8c5d01835859394768bde1b530c (diff) |
Gracefully handle undefined data in getTreeEntries()
Diffstat (limited to 'app/assets/javascripts/diffs/workers')
-rw-r--r-- | app/assets/javascripts/diffs/workers/tree_worker.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/assets/javascripts/diffs/workers/tree_worker.js b/app/assets/javascripts/diffs/workers/tree_worker.js index 534d737c77e..415c463fd19 100644 --- a/app/assets/javascripts/diffs/workers/tree_worker.js +++ b/app/assets/javascripts/diffs/workers/tree_worker.js @@ -4,6 +4,11 @@ import { generateTreeList } from '../store/utils'; // eslint-disable-next-line no-restricted-globals self.addEventListener('message', e => { const { data } = e; + + if (data === undefined) { + return; + } + const { treeEntries, tree } = generateTreeList(data); // eslint-disable-next-line no-restricted-globals |