Be prepared for empty repositories

Before this patch, cgit would segfault on repositories with no refs.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
This commit is contained in:
Lars Hjemli
2008-07-27 12:32:08 +02:00
والد 2d6ee032d0
کامیت 25c84326de
2فایلهای تغییر یافته به همراه9 افزوده شده و 4 حذف شده

مشاهده پرونده

@ -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)