If damage would be dealt to a player, that player exiles that many cards from the top of their library instead.
If you have no cards in your library, then damage done to you will have no effect since it will get changed into a removal that can’t happen.
The ability affects all players.