summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-08-09 15:50:33 +0100
committerCarl Hetherington <cth@carlh.net>2014-08-09 15:50:33 +0100
commit9f2de5d90ceed509ece2263f2bba6764f31d4988 (patch)
tree172fd7eb7acc360f66683d88f31fcbe62dcc6e23
parent4388fff5376a6e5a6dc8d33e244a1245a728335c (diff)
Fix crash with no film.
-rw-r--r--src/wx/film_editor.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc
index 98d30a2a3..d0534f9c0 100644
--- a/src/wx/film_editor.cc
+++ b/src/wx/film_editor.cc
@@ -879,7 +879,10 @@ ContentList
FilmEditor::selected_content ()
{
ContentList sel;
- long int s = -1;
+
+ if (!_film) {
+ return sel;
+ }
/* The list was populated using a sorted content list, so we must sort it here too
so that we can look up by index and get the right thing.
@@ -887,6 +890,7 @@ FilmEditor::selected_content ()
ContentList content = _film->content ();
sort (content.begin(), content.end(), ContentSorter ());
+ long int s = -1;
while (true) {
s = _content->GetNextItem (s, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
if (s == -1) {