Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FontIcon: NPE if ikon property not set #16

Closed
AlexFalappa opened this issue Dec 13, 2017 · 2 comments
Closed

FontIcon: NPE if ikon property not set #16

AlexFalappa opened this issue Dec 13, 2017 · 2 comments
Labels

Comments

@AlexFalappa
Copy link

Forgetting to set the ikon property but setting the size as in:

FontIcon fi = new FontIcon();
fi.setIconSize(32);
jLabel.setIcon(fi);

leads to:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
	at org.kordamp.ikonli.swing.FontIcon.setIconSize(FontIcon.java:92)
	at af.AppFrame.<init>(AppFrame.java:15)
...

This is because the font variable in FontIcon is left uninitialized but used in the setIconSize method.

Perhaps the ikon property should be required as a constructor argument?

@AlexFalappa
Copy link
Author

AlexFalappa commented Dec 14, 2017

Are you going to publish to Maven Central another version with the recent fixes/enhancements?

@aalmiray
Copy link
Collaborator

Yes, soon. I'm still collecting issues and features before publishing the next release. There were 3 issues fixed yesterday plus 4 new icon packs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants