Fixed NULL dereference.

This commit is contained in:
casey langen 2020-03-01 00:16:29 -08:00
parent f7039b9a25
commit 10998add43
2 changed files with 7 additions and 1 deletions

View File

@ -136,7 +136,8 @@ enum PDC_port
PDC_PORT_OS2 = 4,
PDC_PORT_SDL1 = 5,
PDC_PORT_SDL2 = 6,
PDC_PORT_VT = 7
PDC_PORT_VT = 7,
PDC_PORT_DOSVGA = 8
};
/* Use this structure with PDC_get_version() for run-time info about the

View File

@ -111,6 +111,11 @@ size_t ScrollAdapterBase::GetVisibleItems(
void ScrollAdapterBase::DrawPage(ScrollableWindow* scrollable, size_t index, ScrollPosition& result) {
WINDOW* window = scrollable->GetContent();
if (!window) {
return;
}
werase(window);
if (!scrollable->IsVisible() || !window || this->height == 0 || this->width == 0 || this->GetEntryCount() == 0) {