Skip to content

Commit

Permalink
fix NRE
Browse files Browse the repository at this point in the history
  • Loading branch information
SirSparkles committed Jun 15, 2022
1 parent 02c22d7 commit e34aa06
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion TVRename/Forms/BulkAddMovies/BulkAddEditMovie.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public partial class BulkAddEditMovie : Form

public BulkAddEditMovie([NotNull] PossibleNewMovie hint)
{
codeFinderControl = new MovieCodeFinder("", TVSettings.Instance.DefaultMovieProvider) { Dock = DockStyle.Fill };
InitializeComponent();

codeFinderControl = new MovieCodeFinder("", TVSettings.Instance.DefaultMovieProvider) { Dock = DockStyle.Fill };
codeFinderControl.SelectionChanged += CodeChanged;
codeFinderControl.lvMatches.DoubleClick += MatchDoubleClick;

Expand Down
2 changes: 1 addition & 1 deletion TVRename/Forms/BulkAddShows/BulkAddEditShow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public partial class BulkAddEditShow : Form

public BulkAddEditShow([NotNull] PossibleNewTvShow hint)
{
codeFinderControl = new TvCodeFinder("", TVSettings.Instance.DefaultProvider) { Dock = DockStyle.Fill };
InitializeComponent();

codeFinderControl = new TvCodeFinder("", TVSettings.Instance.DefaultProvider) { Dock = DockStyle.Fill };
codeFinderControl.SelectionChanged += CodeChanged;
codeFinderControl.lvMatches.DoubleClick += MatchDoubleClick;
label1.Text = $"Search for {TVSettings.Instance.DefaultProvider.PrettyPrint()} entry, by partial name or ID:";
Expand Down
6 changes: 3 additions & 3 deletions TVRename/Forms/ShowPreferences/AddEditMovie.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public AddEditMovie([NotNull] MovieConfiguration si, TVDoc doc)
{
selectedShow = si;
mDoc = doc;
codeFinderForm =
new MovieCodeFinder(si.Code != -1 ? si.Code.ToString() : si.LastName, si.Provider) { Dock = DockStyle.Fill };

InitializeComponent();
HasChanged = false;

Expand All @@ -47,9 +50,6 @@ public AddEditMovie([NotNull] MovieConfiguration si, TVDoc doc)

lblSeasonWordPreview.ForeColor = Color.DarkGray;

codeFinderForm =
new MovieCodeFinder(si.Code != -1 ? si.Code.ToString() : si.LastName, si.Provider) { Dock = DockStyle.Fill };

codeFinderForm.SelectionChanged += MTCCF_SelectionChanged;

pnlCF.SuspendLayout();
Expand Down
4 changes: 2 additions & 2 deletions TVRename/Forms/ShowPreferences/AddEditShow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ public AddEditShow([NotNull] ShowConfiguration si, TVDoc doc)
sampleProcessedSeason = si.GetFirstAvailableSeason();
sampleEpisode = si.GetFirstAvailableEpisode();
addingNewShow = si.TvdbCode == -1 && si.TmdbCode == -1 && si.TVmazeCode == -1;
codeFinderForm = new TvCodeFinder(si.Code != -1 ? si.Code.ToString() : si.LastName, si.Provider) { Dock = DockStyle.Fill };

InitializeComponent();
HasChanged = false;

Expand All @@ -56,8 +58,6 @@ public AddEditShow([NotNull] ShowConfiguration si, TVDoc doc)

SetupDropDowns(si);

codeFinderForm = new TvCodeFinder(si.Code != -1 ? si.Code.ToString() : si.LastName, si.Provider) { Dock = DockStyle.Fill };

codeFinderForm.SelectionChanged += MTCCF_SelectionChanged;

pnlCF.SuspendLayout();
Expand Down

0 comments on commit e34aa06

Please sign in to comment.