Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

自行编译的4.0.4.0出现错误 #1236

Closed
thelastlin opened this issue Jul 12, 2017 · 8 comments
Closed

自行编译的4.0.4.0出现错误 #1236

thelastlin opened this issue Jul 12, 2017 · 8 comments

Comments

@thelastlin
Copy link

thelastlin commented Jul 12, 2017

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

版本

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)```
@celeron533
Copy link
Contributor

celeron533 commented Jul 13, 2017

可能是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;

@thelastlin
Copy link
Author

thelastlin commented Jul 13, 2017

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

@celeron533

@wongsyrone
Copy link
Contributor

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

@wongsyrone
Copy link
Contributor

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

@celeron533
Copy link
Contributor

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

@thelastlin
Copy link
Author

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

@JonasGao
Copy link
Contributor

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

@celeron533
Copy link
Contributor

Fixed in 081bbaf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants