Fix crash and tidy up hints when there is no content.
authorCarl Hetherington <cth@carlh.net>
Mon, 4 Mar 2013 19:51:26 +0000 (19:51 +0000)
committerCarl Hetherington <cth@carlh.net>
Mon, 4 Mar 2013 19:51:26 +0000 (19:51 +0000)
src/wx/film_editor.cc

index a19d2fff13ffe369e28bd1e50e8350d26161a840..8330e3d3e8841af92155f87122a27956bbc04c4f 100644 (file)
@@ -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 ();
+               }
        }
 }