From d8ee90e5f12a30246576550556bf71a577b88fa3 Mon Sep 17 00:00:00 2001 From: RKrom Date: Wed, 11 Apr 2012 11:23:17 +0000 Subject: [PATCH] Fixed exception due to wrong init. git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1773 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4 --- GreenshotJiraPlugin/Forms/SettingsForm.cs | 3 +-- GreenshotJiraPlugin/JiraPlugin.cs | 13 +++++++------ GreenshotPlugin/Controls/GreenshotForm.cs | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/GreenshotJiraPlugin/Forms/SettingsForm.cs b/GreenshotJiraPlugin/Forms/SettingsForm.cs index a4e60c06f..264126e33 100644 --- a/GreenshotJiraPlugin/Forms/SettingsForm.cs +++ b/GreenshotJiraPlugin/Forms/SettingsForm.cs @@ -27,9 +27,8 @@ namespace GreenshotJiraPlugin { /// Description of PasswordRequestForm. /// public partial class SettingsForm : GreenshotPlugin.Controls.GreenshotForm { - private ILanguage lang = Language.GetInstance(); - public SettingsForm(JiraConfiguration config) { + language = Language.GetInstance(); // // The InitializeComponent() call is required for Windows Forms designer support. // diff --git a/GreenshotJiraPlugin/JiraPlugin.cs b/GreenshotJiraPlugin/JiraPlugin.cs index 54e8fdf23..58edcf119 100644 --- a/GreenshotJiraPlugin/JiraPlugin.cs +++ b/GreenshotJiraPlugin/JiraPlugin.cs @@ -120,12 +120,13 @@ namespace GreenshotJiraPlugin { /// public virtual void Configure() { string url = config.Url; - config.ShowConfigDialog(); - // check for re-login - if (jiraConnector.isLoggedIn && !string.IsNullOrEmpty(url)) { - if (!url.Equals(config.Url)) { - jiraConnector.logout(); - jiraConnector.login(); + if (config.ShowConfigDialog()) { + // check for re-login + if (jiraConnector != null && jiraConnector.isLoggedIn && !string.IsNullOrEmpty(url)) { + if (!url.Equals(config.Url)) { + jiraConnector.logout(); + jiraConnector.login(); + } } } } diff --git a/GreenshotPlugin/Controls/GreenshotForm.cs b/GreenshotPlugin/Controls/GreenshotForm.cs index cde1d310b..ac1a270ce 100644 --- a/GreenshotPlugin/Controls/GreenshotForm.cs +++ b/GreenshotPlugin/Controls/GreenshotForm.cs @@ -46,7 +46,7 @@ namespace GreenshotPlugin.Controls { /// protected void ApplyLanguage() { if (language == null) { - throw new ArgumentNullException("Language not set!!"); + throw new ArgumentNullException("Language not set!! Please use 'language = Language.GetInstance()' in your form constructor!"); } // Set title of the form if (!string.IsNullOrEmpty(LanguageKey)) {