From c498adf4db4c55c3bd58f976df315cf7568702d2 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Sat, 20 Feb 2016 22:14:51 -0500 Subject: [PATCH] Fix bug reported on the list by Philip Pirrip. It is possible that paramsToDialog is called when we do not have a BufferView and so do not have a Buffer. --- src/frontends/qt4/GuiDocument.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index 60aee1ccfb..f76f7248a2 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -3039,7 +3039,10 @@ void GuiDocument::paramsToDialog() biblioChanged_ = false; // indices - indicesModule->update(bp_, buffer().isReadonly()); + // We may be called when there is no BufferView and so no Buffer, + // e.g., when the last view has just been closed. + bool const isReadOnly = buffer() ? buffer().isReadonly() : false; + indicesModule->update(bp_, isReadOnly); // language & quotes int const pos = langModule->languageCO->findData(toqstr(