Empyreus / lanterna

Automatically exported from code.google.com/p/lanterna
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Bugfix in SwingTerminal resizing #48

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi!

I noticed that the SwingTerminal crashes when resized to zero rows and then 
resized again to more than zero rows. I have fixed it by adding checks to make 
sure backbuffer.length > 0 and visibleScreen.length > 0.

The bugfix is available in my lanterna repo clone at 
https://code.google.com/r/vassius-lanterna/
Feel free to merge it. :) 

Link to specific revision: 
https://code.google.com/r/vassius-lanterna/source/detail?r=96c213842b7cae8432995
b2d2f92a960d4daa56c

Affected version is 2.1.1

Stacktrace of error: 

java.lang.ArrayIndexOutOfBoundsException: 0
    at com.googlecode.lanterna.screen.Screen.resizeScreenIfNeeded(Screen.java:369)
    at com.googlecode.lanterna.screen.Screen.refresh(Screen.java:310)

Original issue reported on code.google.com by vass...@gmail.com on 15 Nov 2012 at 4:04

GoogleCodeExporter commented 9 years ago
Excellent, thank you! I've merged in your change to default, 2.1.x and 2.0.x.

Original comment by mab...@gmail.com on 18 Nov 2012 at 9:58