Merge branch 'jc/check-ref-format-oor'
[gitweb.git] / worktree.c
index 2799abd555c774c7f510aba3321b669c74170941..f5da7d286d537fa99a1bd2dd5180068b9d85da2f 100644 (file)
@@ -327,7 +327,8 @@ const struct worktree *find_shared_symref(const char *symref,
                refs = get_worktree_ref_store(wt);
                symref_target = refs_resolve_ref_unsafe(refs, symref, 0,
                                                        NULL, &flags);
-               if ((flags & REF_ISSYMREF) && !strcmp(symref_target, target)) {
+               if ((flags & REF_ISSYMREF) &&
+                   symref_target && !strcmp(symref_target, target)) {
                        existing = wt;
                        break;
                }