diff options
Diffstat (limited to 'gui/terminal.cpp')
-rw-r--r-- | gui/terminal.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gui/terminal.cpp b/gui/terminal.cpp index 65ad2c026..b1799ce63 100644 --- a/gui/terminal.cpp +++ b/gui/terminal.cpp @@ -861,9 +861,12 @@ size_t GUITerminal::GetItemCount() return engine->getLinesCount(); } -void GUITerminal::RenderItem(size_t itemindex, int yPos, bool selected) +void GUITerminal::RenderItem(size_t itemindex, int yPos, bool selected __unused) { const TerminalEngine::Line& line = engine->getLine(itemindex); + + if (!mFont || !mFont->GetResource()) + return; gr_color(mFontColor.red, mFontColor.green, mFontColor.blue, mFontColor.alpha); // later: handle attributes here @@ -887,7 +890,7 @@ void GUITerminal::RenderItem(size_t itemindex, int yPos, bool selected) } } -void GUITerminal::NotifySelect(size_t item_selected) +void GUITerminal::NotifySelect(size_t item_selected __unused) { // do nothing - terminal ignores selections } @@ -897,8 +900,10 @@ void GUITerminal::InitAndResize() // make sure the shell is started engine->initPty(); // send window resize - int charWidth = gr_ttf_measureEx("N", mFont->GetResource()); - engine->setSize(mRenderW / charWidth, GetDisplayItemCount(), mRenderW, mRenderH); + if (mFont && mFont->GetResource()) { + int charWidth = gr_ttf_measureEx("N", mFont->GetResource()); + engine->setSize(mRenderW / charWidth, GetDisplayItemCount(), mRenderW, mRenderH); + } } void GUITerminal::SetPageFocus(int inFocus) |