Most likely, because she has used contraception
I don't remember exactly when the affair takes place (except that it was shortly after WWII, so around 1950s-1960s), but even then there were quite reliable contraception methods:
- The Intrauterine device (IUD) is known since 1800
- The cervical cap is known since 1838
- Latex condom is known since 1928 (ones made from other materials are even older)
- Diaphragm is known since 1880
- The hormone pill has been invented in 1950 (but it wasn't widely available until 1960s, so most likely Hanna wasn't using it)
- There is the natural (although bit unreliable unless not followed closely) Fertility awareness method (often known as "the calendar" method) and the (very unreliable but still widely used) "pull out" (no ejaculation inside the vagina) method.
Hanna is a single woman who isn't looking for serious relationships, but most likely she occasionally has sex (and definitely had in the past), so she wouldn't be a stranger to contraception. Most of them were widely available in post-war Germany, especially the "barrier" methods (like diaphragm and condom), that were protecting from the rampant plague of STI in that time.
Last but not least, there is always abortion - judging by Hanna's past, she wouldn't have many moral issues with that step.