Multibit-Legacy / multibit-hd

Deprecated Bitcoin Wallet
https://multibit.org/blog/2017/07/26/multibit-shutdown.html
Other
169 stars 124 forks source link

IllegalArgumentException in icon create #801

Closed jim618 closed 8 years ago

jim618 commented 8 years ago
java.lang.IllegalArgumentException: Width (0) and height (276) cannot be <= 0
    at java.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknown Source) ~[na:1.7.0_80]
    at java.awt.GraphicsConfiguration.createCompatibleImage(Unknown Source) ~[na:1.7.0_80]
    at org.multibit.hd.ui.views.components.ImageDecorator.toBufferedImage(ImageDecorator.java:77) ~[multibit-hd.jar:na]
    at org.multibit.hd.ui.views.components.ImageDecorator.toImageIcon(ImageDecorator.java:114) ~[multibit-hd.jar:na]
    at org.multibit.hd.ui.views.components.Panels.newDetailBackgroundPanel(Panels.java:213) ~[multibit-hd.jar:na]
    at org.multibit.hd.ui.views.wizards.AbstractWizardPanelView.<init>(AbstractWizardPanelView.java:133) ~[multibit-hd.jar:na]
    at org.multibit.hd.ui.views.wizards.payments.TransactionOverviewPanelView.<init>(TransactionOverviewPanelView.java:64) ~[multibit-hd.jar:na]
    at org.multibit.hd.ui.views.wizards.payments.PaymentsWizard.populateWizardViewMap(PaymentsWizard.java:32) ~[multibit-hd.jar:na]
    at org.multibit.hd.ui.views.wizards.AbstractWizard.<init>(AbstractWizard.java:117) ~[multibit-hd.jar:na]
    at org.multibit.hd.ui.views.wizards.AbstractWizard.<init>(AbstractWizard.java:80) ~[multibit-hd.jar:na]
    at org.multibit.hd.ui.views.wizards.payments.PaymentsWizard.<init>(PaymentsWizard.java:25) ~[multibit-hd.jar:na]
    at org.multibit.hd.ui.views.wizards.Wizards.newPaymentsWizard(Wizards.java:473) ~[multibit-hd.jar:na]

Possibly a missing icon image for the background

jim618 commented 8 years ago

Adding in creation of a single pixel BufferedImage rather than going bang if icon provided is zero height or width. (I've checked the Icon in the stack trace exists so it's not that).

Ready for review and closing.

gary-rowe commented 8 years ago

The references calling this code all seem to use well-established icons so this is probably the best defence against a corrupt Font load.

Closing.