nurpax / petmate

PETSCII editor with Electron/React/Redux
MIT License
181 stars 14 forks source link

Intermittent black screen when hovering over char selector #95

Closed scleikas closed 6 years ago

scleikas commented 6 years ago

This one is somewhat difficult to reproduce, but every now and then, while moving the mouse over the char selector, the screen goes black and the application will stop responding completely.

Running in dev mode, I was able to get the following info from the console. These are the console error messages in order of appearance (oldest to newest):

Uncaught TypeError: Cannot read property 'toString' of undefined at ProxyComponent.render (Statusbar.js:19) at ProxyComponent.hotComponentRender (react-hot-loader.development.js:622) at ProxyComponent.proxiedRender (react-hot-loader.development.js:637) at finishClassComponent (react-dom.development.js:13193) at updateClassComponent (react-dom.development.js:13155) at beginWork (react-dom.development.js:13824) at performUnitOfWork (react-dom.development.js:15863) at workLoop (react-dom.development.js:15902) at HTMLUnknownElement.callCallback (react-dom.development.js:100) at Object.invokeGuardedCallbackDev (react-dom.development.js:138)

The above error occurred in the <CharSelectStatusbar> component: in CharSelectStatusbar (created by CharSelect) in div (created by CharSelect) in CharSelect (created by Connect(CharSelect)) in Connect(CharSelect) (created by Editor) in div (created by Editor) in div (created by Editor) in Editor (created by Connect(Editor)) in Connect(Editor) (created by Route) in Route (created by _default) in Switch (created by _default) in div (created by AppView) in div (created by AppView) in AppView (created by Connect(AppView)) in Connect(AppView) (created by _default) in _default (created by Root) in Router (created by ConnectedRouter) in ConnectedRouter (created by Root) in Provider (created by Root) in Root in e

caught TypeError: Cannot read property 'toString' of undefined at ProxyComponent.render (Statusbar.js:19) at ProxyComponent.hotComponentRender (react-hot-loader.development.js:622) at ProxyComponent.proxiedRender (react-hot-loader.development.js:637) at finishClassComponent (react-dom.development.js:13193) at updateClassComponent (react-dom.development.js:13155) at beginWork (react-dom.development.js:13824) at performUnitOfWork (react-dom.development.js:15863) at workLoop (react-dom.development.js:15902) at renderRoot (react-dom.development.js:15942) at performWorkOnRoot (react-dom.development.js:16560)

It appears the props.curScreencode here is sometimes undefined:

export class CharSelectStatusbar extends PureComponent { render () { return ( <div style={{paddingTop: '4px', fontSize: '0.8em', display: 'flex', flexDirection:'row'}}> <FixedWidthCoord axis='C' number={$${this.props.curScreencode.toString(16).toUpperCase()}} /> </div> ) } }

Hope this helps tracking down the issue.

nurpax commented 6 years ago

Great bug report! Thanks for filing it.