You describe a situation which some philosophers call secondary forgiveness. In other words, you have been hurt indirectly rather than directly by a person’s injustice toward someone who is important to you. Whenever an injustice occurs which hurts you, then you are free to forgive. This can even occur when you do not even know the victim(s) but experience hurt nonetheless. An example of this tertiary forgiveness is this: the leader of your country enters into what you consider to be an unjust war with another country. You can forgive the leader if that is your choice to do so.