[Debugger] Make sure console isn't null before dereferencing it.

Fixes bug #9081