mirror of
https://github.com/clangen/musikcube.git
synced 2024-11-19 20:13:36 +00:00
Fixed a couple other null pointer dereferences.
This commit is contained in:
parent
10998add43
commit
035137d3b8
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user