diff options
| author | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2026-04-28 02:36:56 +0300 |
|---|---|---|
| committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2026-04-28 05:03:42 +0300 |
| commit | 5a1ca24fa9378c57de16b6443e4e9dde7799b6cb (patch) | |
| tree | 6052d910b162bf713889508b8bfeb98081e9977f | |
| parent | 7719e6c16dc182ede6ed4b766d8cec4adf8feeba (diff) | |
#5726 Crash initing in-viewer console
| -rw-r--r-- | indra/llui/llconsole.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp index 91e6f281da..ca512a9883 100644 --- a/indra/llui/llconsole.cpp +++ b/indra/llui/llconsole.cpp @@ -67,6 +67,10 @@ LLConsole::LLConsole(const LLConsole::Params& p) { setFontSize(p.font_size_index); } + if (mFont == nullptr) + { + setFontSize(0); // sans-serif + } mFadeTime = mLinePersistTime - FADE_DURATION; setMaxLines(LLUI::getInstance()->mSettingGroups["config"]->getS32("ConsoleMaxLines")); } @@ -79,6 +83,13 @@ void LLConsole::setLinePersistTime(F32 seconds) void LLConsole::reshape(S32 width, S32 height, bool called_from_parent) { + if (mFont == nullptr) + { + // not initialized yet + LL_WARNS() << "LLConsole::reshape called before font is set" << LL_ENDL; + return; + } + S32 new_width = llmax(50, llmin(getRect().getWidth(), width)); S32 new_height = llmax(mFont->getLineHeight() + 15, llmin(getRect().getHeight(), height)); |
