瀏覽代碼

"fix" the sort function potentially not always outputting results

Henry Jameson 2 年之前
父節點
當前提交
b44df37c1b
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      src/services/theme_data/theme_data.service.js

+ 1 - 0
src/services/theme_data/theme_data.service.js

@@ -138,6 +138,7 @@ export const topoSort = (
     if (depsA === depsB || (depsB !== 0 && depsA !== 0)) return ai - bi
     if (depsA === 0 && depsB !== 0) return -1
     if (depsB === 0 && depsA !== 0) return 1
+    return 0 // failsafe, shouldn't happen?
   }).map(({ data }) => data)
 }