summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-04-07 11:35:48 +0100
committerCarl Hetherington <cth@carlh.net>2013-04-07 11:35:48 +0100
commit74519cfb5e325d6f95a1b583dc471bb970f98ef6 (patch)
tree1890ccc07802ba444437f2b11c496c0e088ae78b /src
parent21ae33095a251da25b3c5a85bc52fad63e04db0b (diff)
Fix crash.
Diffstat (limited to 'src')
-rw-r--r--src/wx/film_viewer.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index 4bc5466bc..4d8685dd0 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -84,15 +84,17 @@ FilmViewer::FilmViewer (shared_ptr<Film> f, wxWindow* p)
_play_button->Connect (wxID_ANY, wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler (FilmViewer::play_clicked), 0, this);
_timer.Connect (wxID_ANY, wxEVT_TIMER, wxTimerEventHandler (FilmViewer::timer), 0, this);
- /* We need a player before we set_film() so that the first frame will be displayed */
- _player = f->player ();
- _player->disable_audio ();
- _player->disable_video_sync ();
- /* Don't disable subtitles here as we may need them, and it's nice to be able to turn them
- on and off without needing obtain a new Player.
- */
-
- _player->Video.connect (bind (&FilmViewer::process_video, this, _1, _2, _3));
+ if (f) {
+ /* We need a player before we set_film() so that the first frame will be displayed */
+ _player = f->player ();
+ _player->disable_audio ();
+ _player->disable_video_sync ();
+ /* Don't disable subtitles here as we may need them, and it's nice to be able to turn them
+ on and off without needing obtain a new Player.
+ */
+
+ _player->Video.connect (bind (&FilmViewer::process_video, this, _1, _2, _3));
+ }
set_film (f);