{"record":{"id":"13327ce3ed0ee1d9","repo":"nodejs/node","slug":"missing-list-file-n","errorCode":null,"errorMessage":"missing list file\\n","messagePattern":"missing list file\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/toolutil/pkg_icu.cpp","lineNumber":65,"sourceCode":"    }\n    return false;\n}\n\n/*\n * Read a file list.\n * If the listname ends with \".txt\", then read the list file\n * (in the system/ invariant charset).\n * If the listname ends with \".dat\", then read the ICU .dat package file.\n * Otherwise, read the file itself as a single-item list.\n */\nU_CAPI Package * U_EXPORT2\nreadList(const char *filesPath, const char *listname, UBool readContents, Package *listPkgIn) {\n    Package *listPkg = listPkgIn;\n    FILE *file;\n    const char *listNameEnd;\n\n    if(listname==nullptr || listname[0]==0) {\n        fprintf(stderr, \"missing list file\\n\");\n        return nullptr;\n    }\n\n    if (listPkg == nullptr) {\n        listPkg=new Package();\n        if(listPkg==nullptr) {\n            fprintf(stderr, \"icupkg: not enough memory\\n\");\n            exit(U_MEMORY_ALLOCATION_ERROR);\n        }\n    }\n\n    listNameEnd=strchr(listname, 0);\n    if(isListTextFile(listname)) {\n        // read the list file\n        char line[1024];\n        char *end;\n        const char *start;\n","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/toolutil/pkg_icu.cpp#L47-L83","documentation":"readList was called with listname NULL or an empty string, so it prints 'missing list file' and returns NULL (it does NOT exit). Callers must treat a NULL return as failure; writePackageDatFile maps it to U_ILLEGAL_ARGUMENT_ERROR.","triggerScenarios":"Invoking icupkg (or calling readList) without supplying a list/package argument, or passing an empty string. The guard `if(listname==nullptr || listname[0]==0)` fires first.","commonSituations":"Wrong icupkg command line (missing positional arg); a wrapper script passing an unset env var that expands to empty; calling readList programmatically without validating the argument.","solutions":["Always pass a non-empty list/package path to icupkg / readList.","In shell, guard the arg: `${LIST:?list file required}` aborts if unset/empty.","Check the return value for NULL and surface a clear error rather than continuing.","Validate argv before invoking icupkg in build scripts."],"exampleFix":"# before\nicupkg \"$MAYBE_EMPTY\" out.dat   # MAYBE_EMPTY is empty -> 'missing list file'\n# after\nicupkg \"${LIST:?list file required}\" out.dat","handlingStrategy":"validation","validationCode":"# never call icupkg/readList without a non-empty list/package path\n[ -n \"$LIST\" ] || { echo \"list file required\" >&2; exit 1; }\nicupkg \"${LIST:?list file required}\" \"$OUT\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass a non-empty list/package argument to icupkg.","In shell use `${VAR:?msg}` to fail fast on unset/empty args.","When calling readList programmatically, check for NULL return and handle it.","Validate argv in build wrappers before invoking icupkg."],"tags":["icu","icupkg","argument-error","build-tools"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}