if there are files (#9030)
if there are files (#9030)

* if there are files

* added back undefined check

Co-authored-by: jon <aa997ae14f262c0fd4362e57d1a1b1c20678c6da@ticmate.com>
wistityhq/strapi,wistityhq/strapi