bugfix: only create dict key if value is not empty
Merge pull request #15276 from hvnsweeting/fix-file-diff

bugfix: only create dict key if value is not empty