Fix: Crash when extra viewport height is zero with sign in view. (#9175)

If a viewport sign straddles the top of a viewport, a crash will occur if the viewport height is zero. This is resolved by simply not attempting to draw the viewport in this situation, consistent with other widgets.

(cherry picked from commit 256dbee255)
This commit is contained in:
PeterN
2021-05-02 10:21:27 +01:00
committed by Jonathan G Rennison
parent 0b4d45af93
commit f9a03c4e63

View File

@@ -2090,7 +2090,7 @@ void NWidgetViewport::SetupSmallestSize(Window *w, bool init_array)
void NWidgetViewport::Draw(const Window *w)
{
if (this->IsOutsideDrawArea()) return;
if (this->current_x == 0 || this->current_y == 0 || this->IsOutsideDrawArea()) return;
this->base_flags &= ~WBF_DIRTY;
if (this->disp_flags & ND_NO_TRANSPARENCY) {