Your code isn't checking the result of match. The following fixes it.
RSTART is set by invoking the match function. Its value is the position of the string where the matched substring starts, or zero if no match was found.
if(RSTART){
user = substr($0, RSTART + 12, RLENGTH - 13)
c[d[1] OFS user]++
}