Null check and remove file content attribute