From 306758719391fab2423f1ec5ea8f8a3470b6a8b6 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 4 Mar 2013 19:51:26 +0000 Subject: [PATCH] Fix crash and tidy up hints when there is no content. --- src/wx/film_editor.cc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index a19d2fff1..8330e3d3e 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -643,7 +643,11 @@ FilmEditor::film_changed (Film::Property p) } setup_dcp_name (); - _format_description->SetLabel (std_to_wx (_film->format()->description ())); + if (_film->format ()) { + _format_description->SetLabel (std_to_wx (_film->format()->description ())); + } else { + _format_description->SetLabel (wxT ("")); + } break; } case Film::CROP: @@ -781,8 +785,14 @@ FilmEditor::film_changed (Film::Property p) } } } - _frame_rate_description->SetLabel (std_to_wx (FrameRateConversion (_film->source_frame_rate(), _film->dcp_frame_rate()).description)); - _best_dcp_frame_rate->Enable (best_dcp_frame_rate (_film->source_frame_rate ()) != _film->dcp_frame_rate ()); + + if (_film->source_frame_rate()) { + _frame_rate_description->SetLabel (std_to_wx (FrameRateConversion (_film->source_frame_rate(), _film->dcp_frame_rate()).description)); + _best_dcp_frame_rate->Enable (best_dcp_frame_rate (_film->source_frame_rate ()) != _film->dcp_frame_rate ()); + } else { + _frame_rate_description->SetLabel (wxT ("")); + _best_dcp_frame_rate->Disable (); + } } } -- 2.30.2