-rw-r--r-- | ui-shared.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ui-shared.c b/ui-shared.c index 209af6e..4280a70 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -513,17 +513,18 @@ void add_hidden_formfields(int incl_head, int incl_search, char *page) if (!ctx.cfg.virtual_root) { url = fmt("%s/%s", ctx.qry.repo, page); if (ctx.qry.path) url = fmt("%s/%s", url, ctx.qry.path); 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) html_hidden("id", ctx.qry.sha1); if (ctx.qry.sha2) html_hidden("id2", ctx.qry.sha2); if (incl_search) { |