commit 3610cdf66944dc790e2e3df666e99f33c45b1ede
Author: Tommaso Cucinotta <[email protected]>
Date:   Tue May 2 17:46:38 2017 +0200

    findadv: fix crash on wrong syntax/usage of word-findadv LFUN from 
mini-command.
---
 src/lyxfind.cpp |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
index c743fb8..d789c01 100644
--- a/src/lyxfind.cpp
+++ b/src/lyxfind.cpp
@@ -1512,6 +1512,11 @@ bool findAdv(BufferView * bv, FindAndReplaceOptions 
const & opt)
        DocIterator cur;
        int match_len = 0;
 
+       // e.g., when invoking word-findadv from mini-buffer wither with
+       //       wrong options syntax or before ever opening advanced F&R pane
+       if (theBufferList().getBuffer(FileName(to_utf8(opt.find_buf_name))) == 
0)
+               return false;
+
        try {
                MatchStringAdv matchAdv(bv->buffer(), opt);
                int length = bv->cursor().selectionEnd().pos() - 
bv->cursor().selectionBegin().pos();

Reply via email to