Update dimHelper.java

Fixed crash bug and fixed surrounding indention.
Completely untested, but should work.