diff options
Diffstat (limited to 'src/VBox/Main/ConsoleImpl.cpp')
-rw-r--r-- | src/VBox/Main/ConsoleImpl.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/VBox/Main/ConsoleImpl.cpp b/src/VBox/Main/ConsoleImpl.cpp index 8f86b10eb..f93ff1ffe 100644 --- a/src/VBox/Main/ConsoleImpl.cpp +++ b/src/VBox/Main/ConsoleImpl.cpp @@ -1273,6 +1273,10 @@ STDMETHODIMP Console::COMGETTER(Machine) (IMachine **aMachine) /* mMachine is constant during life time, no need to lock */ mMachine.queryInterfaceTo (aMachine); + /* callers expect to get a valid reference, better fail than crash them */ + if (mMachine.isNull()) + return E_FAIL; + return S_OK; } |