Shadowsocks-windows: 自行编译的4.0.4.0出现错误

Created on 12 Jul 2017  ·  8Comments  ·  Source: shadowsocks/shadowsocks-windows

由于网络环境所迫,不得不自行拉取并编译。

版本

4.0.4.0(commit:057b148)

环境

Win10 x64 16199, VS2015 Update3, .Net Framework 4.7.02505

重现方法

编译后打开纸飞机并右击其于任务栏通知区域的图标,点击“帮助/显示日志...“即可重现。
注意: 程序目录下还没有gui_config.json这个文件。

日志记录

System.NullReferenceException: 未将对象引用设置到对象的实例。 在 Shadowsocks.View.LogForm..ctor(ShadowsocksController controller, String filename) 位置 *:\****\GitHub\shadowsocks-windows\shadowsocks-csharp\View\LogForm.cs:行号 50 在 Shadowsocks.View.MenuViewController.ShowLogForm() 位置 *:\***\shadowsocks-windows\shadowsocks-csharp\View\MenuViewController.cs:行号 511 在 Shadowsocks.View.MenuViewController.ShowLogItem_Click(Object sender, EventArgs e) 位置 *:\****\shadowsocks-windows\shadowsocks-csharp\View\MenuViewController.cs:行号 890 在 System.Windows.Forms.MenuItem.OnClick(EventArgs e) 在 System.Windows.Forms.MenuItem.MenuItemData.Execute() 在 System.Windows.Forms.Command.Invoke() 在 System.Windows.Forms.Command.DispatchID(Int32 id) 在 System.Windows.Forms.NotifyIcon.WndProc(Message& msg) 在 System.Windows.Forms.NotifyIcon.NotifyIconNativeWindow.WndProc(Message& m) 在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Most helpful comment

如果什么也不设置的话,其实这个程序什么也不能做,查看日志就是在搞笑。这种错误我个人认为没必要处理。

All 8 comments

可能是config没有读到?

LogViewerConfig config = controller.GetConfigurationCopy().logViewer;

topMostTrigger = config.topMost;  // this is line 50
wrapTextTrigger = config.wrapText;
toolbarTrigger = config.toolbarShown;
LogMessageTextBox.BackColor = config.BackgroundColor;
LogMessageTextBox.ForeColor = config.TextColor;
LogMessageTextBox.Font = config.Font;

应该是这样吧。
./gui-config.json删除后按照原重现方法即可重现。

@celeron533

首次运行如果不输入任何服务器信息的话,是不会保存gui-config.json的,就会触发null ref exp

如果什么也不设置的话,其实这个程序什么也不能做,查看日志就是在搞笑。这种错误我个人认为没必要处理。

从使用逻辑方法讲,这个测试用例没有必要,不过也算是花式crash手法之一。

先显示日志是为了解决#1240中的无法导入Android版分享的URL的问题。

其实既然自行拉取编译了,那既然报错顺手 PR 个修补怎么样 😃

Fixed in 081bbaf011374181058a17080c84fd75a9eb67c6

Was this page helpful?
0 / 5 - 0 ratings