Issue with JTextPaneLoggingHandler class

To all whom it may concern,
I found the bug related to logger functionality in open source version of your product.
The bug was causing a problem with logging to JTextPane control on server's GUI. For some time it worked properly, but after random amount of time it was crashing causing firstly the JTextPane to stop working properly and then like in a chain effect other components.

Not only I found the bug, but I believe I managed to solve the problem. It was causing three different exceptions to be thrown without no special logic behind it: two were NullPointerExceptions and one was BadLocationException. It was located in JTextPaneLoggingHandler class in the part responsible for scrolling JTextPane to the last row.
After adding just one condition testing if the document length is less than maxBufferSize = 30000 it performs scroll action in other case it reports error to software's log.
So the code looks like this now:

SwingUtilities.invokeLater(() -> {
try {
if(document.getLength() < this.maxBuffersize){//we must check if the document length is valid, lack of this condition caused critical errors.
JTextPaneLoggingHandler.this.jTextPane.setCaretPosition(document.getEndPosition().getOffset());//because document length is valid we can perform operation scroll to end pos offset
}else{
reportError("Document's length was bigger than "+this.maxBuffersize, null, ErrorManager.GENERIC_FAILURE);//because the length wasn't valid we need to report an error
}
} catch (Throwable e) {
reportError(e.getLocalizedMessage(), (Exception)e, ErrorManager.GENERIC_FAILURE);//reporting an exception, for an instance it will be BadLocationException
}
});

I tested it using simple bash script: while(true) do nc -vz localhost 3305; sleep 2; done.
My solution will throw just a BadLocationException and will handle it so nothing happens even after some time, but the thing is just to suggest you the way how to sort this thing out.
I would like to ask you for solving the problem for next release of your software in any way, but just to fix it.
No other changes were made to your software.
Greetings and looking forward for any type of reaction from you.

Forum
OFTP2

Comments