Added a check for an empty dependency item. Was causing an error.

When the array is empty, the replace method was causing an error. I don't know the root cause of the issue (why the array is empty) but checking this condition allows the program to continue.