Fix try to delete file while it does not exist anymore (see #2102 and #1713) in reference to this issue (V3.9)

Remove warning if file does not exist already and check if file is null elsewhere.

see comments in #2102 and #1713