Most of the pessimistic alien-encounter scenarios involve the aliens' wiping us out for reasons of convenience. They need our resources, and we're either pointless or competitive to keep around.
Personally, I find that argument a little naive and anthropocentric. Who's to say they need our resources? Couldn't they find resources aplenty in asteroids, on planets closer to their home, or through artificial synthesis? It makes little economic or biological sense to go through the trouble of exploring vast, deep regions of space purely for the purposes of acquiring resources. (And that's even assuming they need the same resources we do, in the first place.)
In all likelihood, an alien intelligence that made itself deliberately known to us would be doing it for scientific or diplomatic reasons. If they want our planet, they could just take it. There'd be no need even to deal with us; they could just lob a few asteroid-sized objects at our planet, eradicate life on the surface, then come in and harvest away.
To your point: any sufficiently advanced intelligence that's going to bother interacting with us will probably have studied us well in advance. It will know as much as it can about us. It might (depending on its alien mindset) have a good understanding of our potential sentience, and a respect for sentience in general.
The real threat isn't from alien intelligence, but from alien AI. A dumb AI, at that, of the kind that mindlessly travels the galaxy, self-replicates, and harvests material without discrimination. But again: a race advanced enough to develop such technology would probably be aware of the consequences of letting it run amok. There would be checks against that scenario by design.
We're very quick to ascribe a bleak, law-of-the-jungle amorality to alien intelligence. But let's think about it. Such an intelligence had many "tests" to pass: a nuclear age (or some equivalent thereof), climate change (or some equivalent thereof), wars, and so forth. If it's far more advanced than we are, it probably passed and survived all those tests to get there. It's very hard to pass those tests in the absence of a complex, well-developed ethical system.