Browse Source

Language protocol: fixed potential crash in hover method

merge-requests/365/head
eidheim 8 years ago
parent
commit
897e570ae0
  1. 7
      src/source_language_protocol.cc

7
src/source_language_protocol.cc

@ -925,10 +925,11 @@ void Source::LanguageProtocolView::show_type_tooltips(const Gdk::Rectangle &rect
} }
if(content.empty()) { if(content.empty()) {
auto contents_it=result.find("contents"); auto contents_it=result.find("contents");
if(contents_it!=result.not_found()) if(contents_it!=result.not_found()) {
content=contents_it->second.get_value<std::string>("");
if(content.empty())
content=contents_it->second.get<std::string>("value", ""); content=contents_it->second.get<std::string>("value", "");
if(content.empty())
content=contents_it->second.get_value<std::string>("");
}
} }
if(!content.empty()) { if(!content.empty()) {
dispatcher.post([this, offset, content=std::move(content)] { dispatcher.post([this, offset, content=std::move(content)] {

Loading…
Cancel
Save