Fix NPE in fillGap(boolean)