Skip to content

Commit

Permalink
fix null reference exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeric-X committed Feb 19, 2021
1 parent 6900826 commit e66cc7b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
3 changes: 3 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v1.1.7
- fix null reference exception

v1.1.6
- 整理目录
- trying to fix #5
Expand Down
2 changes: 1 addition & 1 deletion SyncClipboard/Control/ClipboardListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected override void DefWndProc(ref Message m)
{
if (m.Msg == WM_CLIPBOARDUPDATE)
{
ClipBoardChanged.Invoke();
ClipBoardChanged?.Invoke();
}
else
{
Expand Down
11 changes: 5 additions & 6 deletions SyncClipboard/UpdateChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace SyncClipboard
{
class UpdateChecker
{
public const string Version = "1.1.6";
public const string Version = "1.1.7";
public const string UpdateUrl = "https://api.github.com/repos/Jeric-X/SyncClipboard/releases/latest";
public const string ReleaseUrl = "https://github.com/Jeric-X/SyncClipboard/releases/latest";

Expand All @@ -28,15 +28,14 @@ public bool Check()
try
{
p1 = serializer.Deserialize<UpdateConvertJson>(strReply);
if (String.Compare(p1.name, "v" + Version) > 0){


if (MessageBox.Show("v" + Version + " -> " + p1.name + "\n\n是否更新", "检测到新版本", MessageBoxButtons.OKCancel) == DialogResult.OK)
if (String.Compare(p1.name, "v" + Version) > 0)
{
if (MessageBox.Show("v" + Version + " -> " + p1.name + "\n\n是否更新", "检测到新版本" + p1.name, MessageBoxButtons.OKCancel) == DialogResult.OK)
System.Diagnostics.Process.Start(UpdateChecker.ReleaseUrl);
}
else
{
MessageBox.Show("当前版本为最新版本", "更新");
MessageBox.Show("当前版本v" + Version +"为最新版本", "更新");
}
}
catch (Exception e)
Expand Down

0 comments on commit e66cc7b

Please sign in to comment.