Commit d0b34e00 authored by Mark Nauwelaerts's avatar Mark Nauwelaerts
Browse files

lspclient: tighten data validity checks before applying mark

parent 08177378
......@@ -615,10 +615,14 @@ public:
KTextEditor::ConfigInterface *ciface = qobject_cast<KTextEditor::ConfigInterface *>(activeView);
auto url = item->data(RangeData::FileUrlRole).toUrl();
if (url != doc->url())
// document url could end up empty while in intermediate reload state
// (and then it might match a parent item with no RangeData at all)
if (url != doc->url() || url.isEmpty())
KTextEditor::Range range = item->data(RangeData::RangeRole).value<LSPRange>();
if (!range.isValid() || range.isEmpty())
auto line = range.start().line();
RangeData::KindEnum kind = RangeData::KindEnum(item->data(RangeData::KindRole).toInt());
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment