From 24d4b82f2d4a52c0875faed8ced15a341ab052a1 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sat, 13 Oct 2012 13:47:15 +0200 Subject: [PATCH] getSelections can return empty ldomXRangeList --- cre.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cre.cpp b/cre.cpp index 93e0f113d..485d54f3b 100644 --- a/cre.cpp +++ b/cre.cpp @@ -421,6 +421,11 @@ static int getPageLinks(lua_State *L) { ldomXRangeList links; ldomXRangeList & sel = doc->text_view->getDocument()->getSelections(); + + if ( sel.length() == 0 ) { + return 0; + } + doc->text_view->getCurrentPageLinks( links ); int linkCount = links.length(); if ( linkCount ) {