NOVA-Team / NOVA-Monorepo

The core API of the NOVA voxel game modding system
https://nova-team.github.io
GNU Lesser General Public License v3.0
66 stars 23 forks source link

Fix NPE in DirectionConverter #275

Closed ExE-Boss closed 7 years ago

ExE-Boss commented 7 years ago

This PR fixes a NPE in the DirectionConverter switch statement. Minecraft’s EnumFacing can be null, but a switch statement throws a NPE when it is passed a null parameter instead of going to the default case.

codecov-io commented 7 years ago

Codecov Report

Merging #275 into master will increase coverage by 0.02%. The diff coverage is 66.66%.

@@             Coverage Diff              @@
##             master     #275      +/-   ##
============================================
+ Coverage     13.48%   13.51%   +0.02%     
- Complexity      674      676       +2     
============================================
  Files           405      405              
  Lines         11885    11889       +4     
  Branches       1258     1260       +2     
============================================
+ Hits           1603     1607       +4     
  Misses        10183    10183              
  Partials         99       99
Impacted Files Coverage Δ Complexity Δ
...apper/mc/forge/v17/wrapper/DirectionConverter.java 85.71% <66.66%> (+1.5%) 15 <7> (+1) :white_check_mark:
...apper/mc/forge/v18/wrapper/DirectionConverter.java 85.71% <66.66%> (+1.5%) 15 <7> (+1) :white_check_mark:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5b4dc92...032416e. Read the comment docs.

RX14 commented 7 years ago

Why on earth would switch (null) not trigger the default label? Fucking java.