Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

Network: crashes with width constraint of lines with space and large word #3464

Closed
wimrijnders opened this issue Sep 20, 2017 · 2 comments
Closed

Comments

@wimrijnders
Copy link
Contributor

This comment by @Maniae, discussion moved from #3228.

I experienced crashes thrown from LabelAccumulator:

Uncaught TypeError: Cannot read property 'blocks' of undefined
at LabelAccumulator.finalize (Label.js:117)
at Label._processLabelText (Label.js:1200)
at Label._processLabel (Label.js:1212)
at Label.getTextSize (Label.js:656)
at Box.getDimensionsFromLabel (NodeBase.js:280)
at Box.resize (Box.js:29)
at Box._updateBoundingBox (NodeBase.js:236)
at Box.updateBoundingBox (Box.js:69)
at Box.draw (Box.js:55)
at Node.draw (Node.js:504)

This is happening every time a label, or a new line of the label, starts with a blank character followed by a word too large for the label width.
Also thrown when using two LF characters in a label. ("\n\n" throws the error, but "\r\n\r\n" doesn't)

@wimrijnders
Copy link
Contributor Author

wimrijnders commented Sep 20, 2017

@Maniae That went straight into the unit tests. Unfortunately, the test succeeds. Would you mind adding some minimal code in order to reproduce the error?

I'm hereby assuming that you are using the develop-branch, since LabelAccumulator is not in production yet. If I can confirm this, I'm going to ask you to open a new issue on this.

In any case, thanks for reporting!


Update: Ha! got it. I had to juggle a bit with length of words and the width constraint.
Okay, so shit's become serious. Can you please open a new issue with your text as comment? Never mind, I did it myself.

@wimrijnders
Copy link
Contributor Author

This is the first time I experience an issue being reported on the develop-branch, before it went into a release. Thank you @Maniae for reporting so early!

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

No branches or pull requests

2 participants