LPS-44312 Fix NPE when adding new files to DM

This should fix the regression caused by LPS-44098.