]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-shared.c
Be prepared for empty repositories
[ps-cgit] / ui-shared.c
index 209af6ee3acabfc77abc11dd641f2e5d09047ce7..4280a70432b0a3f7869f0a6ddfa132df0af829c7 100644 (file)
@@ -518,7 +518,8 @@ void add_hidden_formfields(int incl_head, int incl_search, char *page)
                html_hidden("url", url);
        }
 
-       if (incl_head && strcmp(ctx.qry.head, ctx.repo->defbranch))
+       if (incl_head && ctx.qry.head && ctx.repo->defbranch &&
+           strcmp(ctx.qry.head, ctx.repo->defbranch))
                html_hidden("h", ctx.qry.head);
 
        if (ctx.qry.sha1)