keymanapp / keyman

Keyman cross platform input methods system running on Android, iOS, Linux, macOS, Windows and mobile and desktop web
https://keyman.com/
Other
372 stars 102 forks source link

bug(developer): a package with a File element missing a Name element crashes kmc #11351

Closed mcdurdin closed 2 weeks ago

mcdurdin commented 2 weeks ago

kmc 17.0.316-beta.

Compiling a .kps that is missing <Name>...</Name> for a <File/> element causes the compiler to crash:

TypeError: The "path" argument must be of type string. Received undefined
  File "node:internal/errors", line 399, col 5, in new NodeError
  File "node:internal/validators", line 163, col 11, in validateString
  File "node:path", line 752, col 5, in Module.basename
  File "../../../src/compiler/package-metadata-collector.ts", line 43, col 59, in file
  File "<anonymous>", in Array.find
  File "../../../src/compiler/package-metadata-collector.ts", line 43, col 26, in PackageMetadataCollector.getKeyboardFileData
  File "../../../src/compiler/package-metadata-collector.ts", line 26, col 34, in PackageMetadataCollector.collectKeyboardMetadata
  File "../../../src/compiler/kmp-compiler.ts", line 348, col 32, in KmpCompiler.transformKpsFileToKmpObject
  File "../../../src/compiler/kmp-compiler.ts", line 154, col 22, in KmpCompiler.transformKpsToKmpObject
  File "../../../src/compiler/kmp-compiler.ts", line 95, col 30, in KmpCompiler.run
sentry-io[bot] commented 2 weeks ago

Sentry Issue: KEYMAN-DEVELOPER-1XH