If the creature you control is a legal target but the creature you don’t control isn’t as Rabid Gnaw resolves, the creature you control will get +1/+0 until end of turn, but no damage will be dealt. If instead the creature you control is an illegal target but the creature you don’t control is still a legal target, nothing will happen when Rabid Gnaw resolves.