Skip to content

Commit

Permalink
Fix possible NPE when calculating knockback.
Browse files Browse the repository at this point in the history
Closes #1731
  • Loading branch information
bonii-xx committed Aug 19, 2015
1 parent 12109a1 commit ba18f02
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/tconstruct/library/tools/AbilityHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ public static int calcDamage(Entity user, Entity entity, ItemStack stack, ToolCo

public static float calcKnockback(Entity user, Entity entity, ItemStack stack, ToolCore tool, NBTTagCompound toolTags, int baseDamage)
{
if(user == null) return 0;
float knockback = 0;

if (entity instanceof EntityLivingBase && user instanceof EntityLivingBase)
Expand Down

0 comments on commit ba18f02

Please sign in to comment.