lwillmeth / ASCII_Art

Convert a single image to ASCII artwork
GNU General Public License v3.0
2 stars 1 forks source link

Problem with filechooser returning a null pointer if no file is chosen. #3

Closed lwillmeth closed 10 years ago

lwillmeth commented 10 years ago

In GUI_ButtonPanel.java, the method loadImage has a problem if no file is chosen it returns a null pointer exception because it's forced to return an ImageIcon.

I think the solution is to change the method is written, possibly using a try/catch to return a default ImageIcon if no file is selected.

There are probably other, better solutions as well.

shredcoder commented 10 years ago

fixed by putting conditions in the resizemethod in buttonpanel class and a condition in a getter method in the displaypanel class. It forces it to point to an image of our choosing if the filepath is null