As I fixed a failing test in bug 609890, I noticed that the hud can be undefined while HS_deactiveHUDForContext is called. perhaps we just need to return early if hud is undefined? maybe there is a deeper issue here? I wrapped:
in a try catch in my patch for bug 609890 to just ignore the error for now. This may also be a problem strictly in testing.