check_aliased_update(): check that dst_name is non-NULL
[gitweb.git] / builtin / receive-pack.c
index c8e32b297c4be68bb0d33a6a88c15470821ae4ea..49cc88d72f28205bfa909408ba994444d27239ae 100644 (file)
@@ -1081,13 +1081,13 @@ static void check_aliased_update(struct command *cmd, struct string_list *list)
        if (!(flag & REF_ISSYMREF))
                return;
 
-       dst_name = strip_namespace(dst_name);
        if (!dst_name) {
                rp_error("refusing update to broken symref '%s'", cmd->ref_name);
                cmd->skip_update = 1;
                cmd->error_string = "broken symref";
                return;
        }
+       dst_name = strip_namespace(dst_name);
 
        if ((item = string_list_lookup(list, dst_name)) == NULL)
                return;