Skip to content

Commit

Permalink
Modified null check
Browse files Browse the repository at this point in the history
  • Loading branch information
HanSolo committed May 24, 2018
1 parent 54005bc commit 7f21691
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/eu/hansolo/medusa/FGauge.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,14 @@ public FGauge(final Gauge GAUGE, final GaugeDesign DESIGN, final GaugeBackground
gaugeBackground = BACKGROUND;

Skin skin = gauge.getSkin();
/*
if (null != skin && gauge.getSkin().getClass() != GaugeSkin.class) {
throw new RuntimeException("Please change Skin to GaugeSkin.");
}
*/
if (null != skin) {
throw new RuntimeException("Please change Skin to a valid Skin.");
}

init();
initGraphics();
Expand Down

2 comments on commit 7f21691

@NeptuneTheMystic
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's been quite some time since I've updated my Medusa source, and since I have, my code did trip up on this (null != skin) check. Can you explain the purpose of this check and what I might do to properly pass it? Commenting the check out allowed my code to run without a hitch, as far as I could tell. Thanks!

@HanSolo
Copy link
Owner Author

@HanSolo HanSolo commented on 7f21691 Feb 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are absolutely right...it should have been skin==null...fixed it with the latest commit...thx for the heads up 👍🏻

Please sign in to comment.