Closed pskowronek closed 1 year ago
Interesting - even javax.swing.text.PlainView
, which SyntaxView
cribs off of, assumes getContainer()
is never null
. I think it should be the case that the conatiner is never null
if that method is called, but perhaps that's not always the case for RSTA. Hopefully you can get more context here, e.g. does this occur before the component is realized or displayed? Thinking of "edge" cases here where things might not be fully initialized yet.
On second thought, do you have multiple threads doing initialization? I don't see how this exception is possible on the line indicated if all GUI work is done on the EDT:
getContainer()
, so it must be non-null
null
In muC we kinda reworked how we initiate RSyntaxTextArea (https://github.com/mucommander/mucommander/issues/841) - since then we cannot produce the problem.
cannot reproduce in muC, closing
Description Possible NPE in SyntaxView.calculateLongestLine.
Steps to Reproduce Not known yet.
Expected behavior No NPE thrown.
Actual behavior NPE is thrown
Additional context
Reported in another project: https://github.com/mucommander/mucommander/issues/841 - of course something might be wrong in muC, but nevertheless
SyntaxView.calculateLongestLine
could check ifc
is not null, especially thatView.getContainer()
states that it may return null.