Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix null attr access #431

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AhmedMozaly
Copy link

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

@MrFiregore
Copy link

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

for example when passing this text:


> open-with-jetbrains@1.0.0 build C:\www\open-con-jetbrains
> pnpm run build:clean && pnpm run build:tsc && pnpm run build:di


> open-with-jetbrains@1.0.0 build:clean C:\www\open-con-jetbrains
> del-cli --force --verbose dist

C:www\open-con-jetbrains\dist

> open-with-jetbrains@1.0.0 build:tsc C:\www\open-con-jetbrains
> tsc -p tsconfig.json


> open-with-jetbrains@1.0.0 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants