If the exception is thrown then current will be null. If current is null then popFile() is a NO-OP. Since popFile() is only called in the exception handler it can be removed. Also remove the other code the IDE marks as unused once popFile() is removed.