libidav/resource.c

changeset 518
cca3e7aa30ed
parent 505
481802342fdf
child 525
26a1d5b9d9d2
--- a/libidav/resource.c	Thu Mar 07 11:47:44 2019 +0100
+++ b/libidav/resource.c	Sat Mar 09 16:29:59 2019 +0100
@@ -82,7 +82,7 @@
 DavResource* dav_resource_new_full(DavSession *sn, char *parent_path, char *name, char *href) {
     sstr_t n = sstr(name);
     // the name must not contain path separators
-    if(n.length > 0) {
+    if(n.length > 0 && href) {
         for(int i=0;i<n.length-1;i++) {
             char c = n.ptr[i];
             if(c == '/' || c == '\\') {

mercurial