Fix the NPE in compactor.