# HG changeset patch # User Chris Cannam # Date 1588178900 -3600 # Node ID 5f8fc01e01c71f6a433e7cfe6f36dbae3c05d7bd # Parent 5b6655449ba6d09df883ae50d5259e84d8346c64 Never blunder ahead without a document at this point! (Could happen if first model was opened using OSC) diff -r 5b6655449ba6 -r 5f8fc01e01c7 framework/MainWindowBase.cpp --- a/framework/MainWindowBase.cpp Wed Apr 29 15:27:13 2020 +0100 +++ b/framework/MainWindowBase.cpp Wed Apr 29 17:48:20 2020 +0100 @@ -1682,8 +1682,13 @@ } } + if (mode != ReplaceSession && !m_document) { + SVDEBUG << "File open mode requested is something other than ReplaceSession, but we have no document at all yet, so we must use ReplaceSession mode" << endl; + mode = ReplaceSession; + } + if (mode == CreateAdditionalModel && getMainModelId().isNone()) { - SVDEBUG << "Mode is CreateAdditionalModel but we have no main model, switching to ReplaceSession mode" << endl; + SVDEBUG << "File open mode requested is CreateAdditionalModel, but we have no main model, so switching to ReplaceSession mode" << endl; mode = ReplaceSession; }