nullptr checks to prevent crashes with no active sequence

This commit is contained in:
itsmattkc
2019-02-15 05:04:10 -08:00
parent 0781e9bb09
commit 78018a79c5
3 changed files with 57 additions and 31 deletions
+15 -6
View File
@@ -514,37 +514,46 @@ void Viewer::resizeEvent(QResizeEvent *e) {
void Viewer::update_viewer() {
update_header_zoom();
viewer_widget->frame_update();
if (seq != nullptr) update_playhead_timecode(seq->playhead);
if (seq != nullptr) {
update_playhead_timecode(seq->playhead);
}
update_end_timecode();
}
void Viewer::clear_in() {
if (seq->using_workarea) {
if (seq != nullptr
&& seq->using_workarea) {
Olive::UndoStack.push(new SetTimelineInOutCommand(seq, true, 0, seq->workarea_out));
update_parents();
}
}
void Viewer::clear_out() {
if (seq->using_workarea) {
if (seq != nullptr
&& seq->using_workarea) {
Olive::UndoStack.push(new SetTimelineInOutCommand(seq, true, seq->workarea_in, seq->getEndFrame()));
update_parents();
}
}
void Viewer::clear_inout_point() {
if (seq->using_workarea) {
if (seq != nullptr
&& seq->using_workarea) {
Olive::UndoStack.push(new SetTimelineInOutCommand(seq, false, 0, 0));
update_parents();
}
}
void Viewer::set_in_point() {
headers->set_in_point(seq->playhead);
if (seq != nullptr) {
headers->set_in_point(seq->playhead);
}
}
void Viewer::set_out_point() {
headers->set_out_point(seq->playhead);
if (seq != nullptr) {
headers->set_out_point(seq->playhead);
}
}
void Viewer::set_zoom(bool in) {