"The defendant said she did not know him very well and was wary of him."
Ms Lawrence said Henare had admitted what happened and complied with police.
Lawyer Ian Hard said the young woman was a boarder at the house and her things had been "rifled through.
"She got very uncomfortable, what she chose to do is confront this man about it.
"Unfortunately, she took a knife in case he attacked her in this confrontation ... she felt quite fearful."
Mr Hard said she had pleaded guilty to the charge at the earliest opportunity.
Judge Mary O'Dwyer said it was a serious incident and Henare had accepted responsibility.
"Your flatmate was at risk from your behaviour, it was a very dangerous thing to present that knife."
She said she was satisfied Henare's mental health was being treated and was intending to see a nurse regularly.
She convicted her and sentenced her to do 100 hours of community work.
She also ordered destruction of the knife.