astefanutti / kubebox

⎈❏ Terminal and Web console for Kubernetes
http://astefanutti.github.io/kubebox
MIT License
2.14k stars 142 forks source link

Fix crash in lib/ui/blessed-xterm/blessed-xterm.js when m1 or m2 is undefined in _selection #101

Closed liji-canva closed 3 years ago

liji-canva commented 3 years ago

If this._selection is defined but this._selection.m1 or this._selection.m2 is undefined, it will crash on line 232 of lib/ui/blessed-xterm/blessed-xterm.js.

I found this issue when I was trying to use lib/ui/blessed-xterm/blessed-xterm.js in my own project when I drag mouse from one blessed screen to an adjacent blessed screen.

I don't know whether you have such case in kubebox, but from the code logic, we can't assume m1 and m2 are defined when this._selection is defined.

astefanutti commented 3 years ago

Thanks a lot. I don't think we've already faced the issue, as there is currently only one Blessed screen in Kubebox.