[gnome-subtitles: 1/2] Fix #138: Crash when opening translation file



commit a1a6abd4791e04b61acc975fc7e6a0777fbd4126
Author: Pedro Castro <pedro gnomesubtitles org>
Date:   Sat Jul 13 16:22:49 2019 +0100

    Fix #138: Crash when opening translation file

 src/GnomeSubtitles/Dialog/FileOpenDialog.cs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/GnomeSubtitles/Dialog/FileOpenDialog.cs b/src/GnomeSubtitles/Dialog/FileOpenDialog.cs
index 3e153e5..e279e37 100644
--- a/src/GnomeSubtitles/Dialog/FileOpenDialog.cs
+++ b/src/GnomeSubtitles/Dialog/FileOpenDialog.cs
@@ -35,6 +35,7 @@ public class FileOpenDialog : BaseDialog {
        
        private string chosenFilename = String.Empty;
        private EncodingDescription chosenEncoding = EncodingDescription.Empty;
+       
        private ArrayList videoFiles = null; //The full paths of the video files in the current dir
        private ArrayList videoFilenames = null; //The filenames of videoFiles, without extensions
        private Uri chosenVideoUri = null;
@@ -319,7 +320,7 @@ public class FileOpenDialog : BaseDialog {
                                        Base.Config.FileOpenEncoding = activeOption;
                        }
 
-                       if (videoComboBox.Active > 0) {
+                       if ((videoComboBox != null) && (videoComboBox.Active > 0)) {
                                int videoFileIndex = videoComboBox.Active - 2;
                                chosenVideoUri = new Uri("file://" + videoFiles[videoFileIndex] as string);
                        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]