Permalink
Browse files

Work around empty directory

  • Loading branch information...
1 parent fa3df98 commit 697cb7ee600cab561ac98bc89734336c755fbb6f @kappa committed Aug 11, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 YandexDisk.pm
View
@@ -126,8 +126,11 @@ sub upload {
my $r = $webdav->propfind("")
or die "Cannot PROPFIND $dir: " . $webdav->message . "\n";
- $basename = will_not_clobber($basename,
- map { basename($_->get_uri->path) } $r->get_resourcelist->get_resources);
+ # if found anything then try not to clobber
+ if ($r->get_resourcelist) {
+ $basename = will_not_clobber($basename,
+ map { basename($_->get_uri->path) } $r->get_resourcelist->get_resources);
+ }
$webdav->put(-local => $upload_filename, -url => "/$dir/$basename")
or die "Cannot upload to $dir: " . $webdav->message . "\n";

0 comments on commit 697cb7e

Please sign in to comment.