Closed charlesgohck closed 7 years ago
Any idea which line in the getNewAvtar()
is giving the nullPointerException?
It seems that my getNewAvatar() is returning a null value. Either that or Filechooser is not executing properly
@tshradheya didn't you implement an avatar feature? I remember someone mentioned an avatar feature here before. @charlesgoh you should be able to find the exact line causing the NPE from the stack trace.
@damithc I implemented something similar to avatar, but I avoided using a FileChooser due to OS difference(only later I realized the problem was with JFileChooser), and I am assuming that could be the reason for the null pointer.
@charlesgoh On doing some research I found out that showOpenDialog()
doesn't allow any further code to be executed until the file chooser is closed(either after selecting[returns file object] or after canceling[returns null]).
So it will help if you know at what stage the NullPointerExcpetion is thrown( before filechooser dialog opens or after you have closed it)
I am currently working on avatar buttons that will change the default image (set via FXML) into the user set image. However, this seems to be giving me NullPointerExceptions, which I am sure is coming from the connection between MainWindow --> PersonListPanel --> PersonCard. Has anyone encountered a similar issue and has managed to fix it successfully? Any advice is appreciated :)
This is my implementation (excluding the setter connection between PersonListPanel and MainWindow):
This is the button ("Avatar") that calls the handler: