In blocksMap, we have seen situations that some BlockInfoContiguous have its BlockCollection == null. This indicates orphan blocks which do not belong to any file.
See HDFS-8113 for more discussions.
Add check for null BlockCollection pointers in BlockInfoContiguous structures
Delete copy-on-truncate block along with the original block, when deleting a file being truncated
Handle possible NPEs due to deleted blocks in race condition