The Hebrew Talmud does indeed say: (derived from Deuteronomy 22:26): Habah l’hargecha hashkem l’hargo — “If someone is coming to kill you, rise against him and kill him first. However, it should never be done with glee.”
I like that!
It’s the law of self defense.... if the man wants to come and murder you unjustly, it is okay to kill him in self defense.