The context of the following conversation is Even though Sydney was very frustrated, Jan prevented Sydney from becoming angry with a hug.:
Jan says Sydney seemed frustrated..
The friend responds What was making her frustrated?.
Jan responds She failed an exam she had been preparing for..
The friend responds That's unlucky, I bet she was angry..
Jan responds I gave her a hug to calm her down and prevent her from being angry..
The friend responds I am sure she appreciates the support..