Fix potential crash when SinguReplaceLinks is off.

This commit is contained in:
Liru Færs
2019-12-31 05:27:06 -05:00
parent 3fec94bb94
commit d9d83a6807

View File

@@ -4228,7 +4228,7 @@ void LLTextEditor::appendTextImpl(const std::string &new_text, const LLStyleSP s
if (always_underline) link_style->mUnderline = true;
appendAndHighlightText(link, part, link_style, !always_underline/*match.underlineOnHoverOnly()*/);
};
const auto&& cb = force_replace_links ? boost::bind(&LLTextEditor::replaceUrl, this, _1, _2, _3) : LLUrlLabelCallback();
const auto&& cb = force_replace_links ? static_cast<LLUrlLabelCallback>(boost::bind(&LLTextEditor::replaceUrl, this, _1, _2, _3)) : LLUrlRegistryNullCallback;
while (!text.empty() && LLUrlRegistry::instance().findUrl(text, match, cb))
{
start = match.getStart();