Skip to content

Commit

Permalink
Merge pull request #640 from thatsIch/b-639-crash-on-disabled-channels
Browse files Browse the repository at this point in the history
Fixes #639 Missing null check for people with disabled channels
  • Loading branch information
thatsIch committed Dec 28, 2014
2 parents f732328 + 0cb58b4 commit e712a9d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/main/java/appeng/core/stats/Achievements.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,42 +121,42 @@ public void setParent( Achievements parent )

public Achievement getAchievement()
{
if ( stat == null && stack != null )
if ( this.stat == null && this.stack != null )
{
stat = new Achievement( "achievement.ae2." + name(), "ae2." + name(), x, y, stack, parent );
stat.registerStat();
this.stat = new Achievement( "achievement.ae2." + this.name(), "ae2." + this.name(), this.x, this.y, this.stack, this.parent );
this.stat.registerStat();
}

return stat;
return this.stat;
}

private Achievements( int x, int y, AEColoredItemDefinition which, AchievementType type )
{
stack = which.stack( AEColor.Transparent, 1 );
this.stack = (which != null) ? which.stack( AEColor.Transparent, 1 ) : null;
this.type = type;
this.x = x;
this.y = y;
}

private Achievements( int x, int y, AEItemDefinition which, AchievementType type )
{
stack = which.stack( 1 );
this.stack = (which != null) ? which.stack( 1 ) : null;
this.type = type;
this.x = x;
this.y = y;
}

private Achievements( int x, int y, ItemStack which, AchievementType type )
{
stack = which;
this.stack = which;
this.type = type;
this.x = x;
this.y = y;
}

public void addToPlayer( EntityPlayer player )
{
player.addStat( getAchievement(), 1 );
player.addStat( this.getAchievement(), 1 );
}

}

0 comments on commit e712a9d

Please sign in to comment.