Given that there isn't exactly a single set of "official rules" for Spades, I would say that there two valid answers:
1) Tricks collected by a set (failed) NIL bid count as tricks for the partner, at which point all normal rules apply as far as sandbags, making the bid, etc. The team loses -100 (or -200 if it was a double/blind Nil) for the set nil, but scores the partner's bid normally.
2) Tricks collected by a set Nil bid are void and count for nothing. The partner must make their bid completely independently.
Players should agree on the rules ahead of play.
Personally, I've always played per #1 and would prefer that greatly. First, it makes losing the nil not quite as painful, since you can help your partner out. Second, it means that while you can take extra tricks to try to set your opponent's bid, you will risk taking sandbags for it, whereas with option 2, you could take those extra tricks with no further penalty.