blessed icon indicating copy to clipboard operation
blessed copied to clipboard

fix null attr access

Open AhmedMozaly opened this issue 1 year ago • 1 comments

I'm using blessed as part of PM2 setup Noticed that PM2 monit command works for some apps but not for other, after checking the issue. It was this error

TypeError: Cannot read properties of null (reading 'slice')
    at /Users/ahmed/.nvm/versions/node/v18.16.0/lib/node_modules/pm2/node_modules/blessed/lib/program.js:2543:35
    at Array.forEach (<anonymous>)
    at Program._attr (/Users/ahmed/.nvm/versions/node/v18.16.0/lib/node_modules/pm2/node_modules/blessed/lib/program.js:2542:11)
    at Element._parseTags (/Users/ahmed/.nvm/versions/node/v18.16.0/lib/node_modules/pm2/node_modules/blessed/lib/widgets/element.js:498:26)
    at Element.parseContent (/Users/ahmed/.nvm/versions/node/v18.16.0/lib/node_modules/pm2/node_modules/blessed/lib/widgets/element.js:393:22)
    at Box.<anonymous> (/Users/ahmed/.nvm/versions/node/v18.16.0/lib/node_modules/pm2/node_modules/blessed/lib/widgets/element.js:184:10)
    at EventEmitter._emit (/Users/ahmed/.nvm/versions/node/v18.16.0/lib/node_modules/pm2/node_modules/blessed/lib/events.js:94:20)
    at EventEmitter.emit (/Users/ahmed/.nvm/versions/node/v18.16.0/lib/node_modules/pm2/node_modules/blessed/lib/events.js:117:12)
    at emit (/Users/ahmed/.nvm/versions/node/v18.16.0/lib/node_modules/pm2/node_modules/blessed/lib/widgets/node.js:109:15)
    at Node.insert (/Users/ahmed/.nvm/versions/node/v18.16.0/lib/node_modules/pm2/node_modules/blessed/lib/widgets/node.js:111:5)

This PR should fix this noisy issue

AhmedMozaly avatar May 21 '23 23:05 AhmedMozaly

happens when there are square brackets as tags, but only opening brackets

for example when passing this text:


> [email protected] build C:\www\open-con-jetbrains
> pnpm run build:clean && pnpm run build:tsc && pnpm run build:di


> [email protected] build:clean C:\www\open-con-jetbrains
> del-cli --force --verbose dist

C:www\open-con-jetbrains\dist

> [email protected] build:tsc C:\www\open-con-jetbrains
> tsc -p tsconfig.json


> [email protected] build:di C:\www\open-con-jetbrains
> copyfiles -V -u 1 ./src/**/*.{json,yaml,html,png,hbs} ./dist

unglobed path: ./src/config.default.json

Note that {json,yaml,html,png,hbs} is not a tag.

MrFiregore avatar Oct 27 '23 22:10 MrFiregore