Don't load news in debug build

This commit is contained in:
Jaex 2017-06-17 09:24:34 +03:00
parent dd9816856b
commit 7d0040b61c

View file

@ -181,18 +181,20 @@ private void InitializeControls()
ExportImportControl.UploadRequested += json => UploadManager.UploadText(json);
#if !DEBUG
ucNews.NewsLoaded += (sender, e) =>
{
if (ucNews.NewsManager.IsUnread && Visible) tsbNews.StartAnimation();
};
ucNews.Start();
HandleCreated += MainForm_HandleCreated;
#endif
#if WindowsStore
tsmiDNSChanger.Visible = false;
tsmiTrayDNSChanger.Visible = false;
#endif
HandleCreated += MainForm_HandleCreated;
}
public void UpdateControls()
@ -1037,7 +1039,7 @@ private void MainForm_VisibleChanged(object sender, EventArgs e)
#if !DEBUG
if (Visible)
{
if (ucNews.NewsManager.IsUnread)
if (ucNews.NewsManager != null && ucNews.NewsManager.IsUnread)
{
tsbNews.StartAnimation();
}