Add null check for outputFiles array