check if j is missing before checking bounds

Was getting error "if (j > x@p | j < 1) stop("index j out of bounds")" when doing mypdist[i, ]