Skip to content

Commit 284e73e

Browse files
committed
fix crash
1 parent 24ef00c commit 284e73e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/main.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ function generateDartWithWorker(content, path, script) {
181181

182182
let dartFilePath = writeOutputToFileByPath(result.dartCode, path)
183183
// collect all enumeratorTypeNames
184-
result.enumeratorTypeNames.forEach(item => enumeratorTypeNames.push(item))
184+
if (result.enumeratorTypeNames) {
185+
result.enumeratorTypeNames.forEach(item => enumeratorTypeNames.push(item))
186+
}
185187
// collect all packages
186188
if (projectName) {
187189
result.packages.forEach(item => packageSet.add(item))

test/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { readFileSync } from "fs"
1+
import { readFileSync } from 'fs'
22
import { program } from 'commander'
33

44
function compareDartFiles(f1, f2) {

0 commit comments

Comments
 (0)