Fixed a couple other null pointer dereferences.

This commit is contained in:
casey langen 2020-03-01 12:45:49 -08:00
parent 10998add43
commit 035137d3b8
2 changed files with 11 additions and 4 deletions

View File

@ -543,6 +543,11 @@ void TransportWindow::Update(TimeMode timeMode) {
}
WINDOW *c = this->GetContent();
if (!c) {
return;
}
auto state = transport.GetPlaybackState();
bool paused = (state == PlaybackPrepared || state == PlaybackPaused);
bool stopped = (state == PlaybackStopped);

View File

@ -767,17 +767,19 @@ IWindow* Window::GetParent() const {
}
void Window::Clear() {
werase(this->content);
wmove(this->content, 0, 0);
if (this->content) {
werase(this->content);
wmove(this->content, 0, 0);
}
bool focused = this->IsFocused();
int64_t contentColor = focused ? this->focusedContentColor : this->contentColor;
int64_t frameColor = focused ? this->focusedFrameColor : this->frameColor;
if (this->content == this->frame) {
if (this->content == this->frame && this->frame) {
wbkgd(this->frame, contentColor);
}
else {
else if (this->frame && this->content) {
wbkgd(this->frame, frameColor);
wbkgd(this->content, contentColor);
}