magda-io / magda-minion-format

Magda Format Minion
Other
0 stars 0 forks source link

Fixed: TypeError: Cannot read property 'trim' of null #14

Closed t83714 closed 3 years ago

t83714 commented 3 years ago

Fixed: TypeError: Cannot read property 'trim' of null

When processing invalid format metadata, the format minion might throw this response:

(node:1) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'trim' of null                                                                         │
│     at /usr/src/app/component/dist/format-engine/measures/dcatFormatMeasure.js:157:34                                                                             │
│     at Array.filter (<anonymous>)                                                                                                                                 │
│     at Object.getMeasureResult [as default] (/usr/src/app/component/dist/format-engine/measures/dcatFormatMeasure.js:157:10)                                      │
│     at getEvaluationSets (/usr/src/app/component/dist/onRecordFound.js:41:51)                                                                                     │
│     at Object.<anonymous> (/usr/src/app/component/dist/onRecordFound.js:26:35)                                                                                    │
│     at Generator.next (<anonymous>)                                                                                                                               │
│     at /usr/src/app/component/dist/onRecordFound.js:8:71                                                                                                          │
│     at new Promise (<anonymous>)                                                                                                                                  │
│     at __awaiter (/usr/src/app/component/dist/onRecordFound.js:4:12)                                                                                              │
│     at Object.onRecordFound (/usr/src/app/component/dist/onRecordFound.js:25:12)