Updated to avoid invalid cast exception thrown.

This commit is contained in:
Mark Downie 2016-01-31 18:12:13 -05:00
parent 2fa7c67263
commit bb1b84f549
1 changed files with 9 additions and 3 deletions

View File

@ -176,9 +176,15 @@ namespace OpenLiveWriter.PostEditor
MovePosts(Path.Combine(_originalFolder + @"\\Drafts\\"), destinationDrafts);
PostEditorForm frm = (PostEditorForm)Application.OpenForms?[0];
PostEditorMainControl ctrl = (PostEditorMainControl)frm?.Controls?[0];
ctrl?.FirePostListChangedEvent();
PostEditorForm frm = Application.OpenForms?[0] as PostEditorForm;
if (frm != null)
{
PostEditorMainControl ctrl = frm.Controls?[0] as PostEditorMainControl;
if (ctrl != null)
{
ctrl.FirePostListChangedEvent();
}
}
}
_postEditorPreferences.Changed();