Skip to content

Commit

Permalink
Fix crash when try to add suspended account (resolves #22)
Browse files Browse the repository at this point in the history
  • Loading branch information
mystasly48 committed Apr 20, 2020
1 parent 033fa85 commit 7a1b1f9
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Mystter_SendTweet/AuthBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ public partial class AuthBrowser : Form {
if (webBrowser1.Url.OriginalString == AuthUrl1 || webBrowser1.Url.OriginalString == AuthUrl2) {
var r = new Regex(@"<CODE>(\d+)</CODE>");
var m = r.Match(webBrowser1.DocumentText);
PIN = m.Result("${1}");
Success = true;
if (m != null) {
PIN = m.Result("${1}");
Success = true;
}
authorizingLabel.Visible = true;
webBrowser1.Visible = false;
webBrowser1.Navigate(LogoutUrl);
Expand Down
2 changes: 2 additions & 0 deletions Mystter_SendTweet/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ public partial class Form1 : Form {
Environment.Exit(0);
break;
}
} else {
MessageBox.Show(Resources.FailedToAddAccount);
}
form.Dispose();
}
Expand Down
9 changes: 9 additions & 0 deletions Mystter_SendTweet/Languages/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Mystter_SendTweet/Languages/Resources.ja.resx
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,7 @@
<data name="WindowClosing" xml:space="preserve">
<value>このウィンドウはまもなく自動で閉じられます...</value>
</data>
<data name="FailedToAddAccount" xml:space="preserve">
<value>アカウントの追加に失敗しました。アカウントが有効であることを確認してください。</value>
</data>
</root>
3 changes: 3 additions & 0 deletions Mystter_SendTweet/Languages/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,7 @@
<data name="WindowClosing" xml:space="preserve">
<value>This window will be closed shortly...</value>
</data>
<data name="FailedToAddAccount" xml:space="preserve">
<value>Failed to add an account. Please check if your account is valid and try again later.</value>
</data>
</root>

0 comments on commit 7a1b1f9

Please sign in to comment.