cherry-picking for 42: file-operation: Return early when basename is NULL
Calling g_utf8_validate() on a NULL string crashes Nautilus. This can occur if performing an operation on an invalid file. If basename is NULL, there's nothing we would do anyways, so just return early and prevent the crash.
There's a similar issue with get_unique_target_file(), but if a bad uri was passed to this function it should fail much earlier, so lets just add an assertion.
Fixes: #2376 (closed)
(cherry picked from commit e2969a9c)