グループ作成で名前に重複がある場合に例外が発生する

Issue #202 closed
sk ☃#QQ repo owner created an issue

ほったん: https://groups.google.com/forum/#!topic/pe_development/hff4geQfQw8

過去の課題#53対応時のスタブコードが残っている。

新規グループ作成で重複時のグループ名インクリメント処理をデフォルト動作としたかったのだがデフォルト動作は#53対応で別処理になっていることを失念していた。

型 'System.NullReferenceException' の初回例外が Utility.dll で発生しました
System.Transactions Critical: 0 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled</TraceIdentifier><Description>処理されていない例外</Description><AppDomain>PeMain.vshost.exe</AppDomain><Exception><ExceptionType>System.NullReferenceException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>オブジェクト参照がオブジェクト インスタンスに設定されていません。</Message><StackTrace>   場所 ContentTypeTextNet.Pe.Library.Utility.TextUtility.ToUnique(String target, IEnumerable`1 list, Func`3 dg) 場所 c:\Users\sk\Documents\Programming\c#\Pe\Pe\Utility\TextUtility.cs:行 29
   場所 ContentTypeTextNet.Pe.PeMain.UI.SettingForm.ToolbarAddGroup(String groupName) 場所 c:\Users\sk\Documents\Programming\c#\Pe\Pe\PeMain\UI\SettingForm.cs:行 1452
   場所 ContentTypeTextNet.Pe.PeMain.UI.SettingForm.ToolToolbarGroup_addGroup_Click(Object sender, EventArgs e) 場所 c:\Users\sk\Documents\Programming\c#\Pe\Pe\PeMain\UI\SettingForm.cs:行 1619
   場所 System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   場所 System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
   場所 System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   場所 System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   場所 System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   場所 System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   場所 System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   場所 System.Windows.Forms.Control.WmMouseUp(Message&amp;amp; m, MouseButtons button, Int32 clicks)
   場所 System.Windows.Forms.Control.WndProc(Message&amp;amp; m)
   場所 System.Windows.Forms.ScrollableControl.WndProc(Message&amp;amp; m)
   場所 System.Windows.Forms.ToolStrip.WndProc(Message&amp;amp; m)
   場所 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp;amp; m)
   場所 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;amp; m)
   場所 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   場所 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp;amp; msg)
   場所 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   場所 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   場所 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   場所 System.Windows.Forms.Application.RunDialog(Form form)
   場所 System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   場所 System.Windows.Forms.Form.ShowDialog()
   場所 ContentTypeTextNet.Pe.PeMain.UI.App.OpenSettingDialog() 場所 c:\Users\sk\Documents\Programming\c#\Pe\Pe\PeMain\UI\App.cs:行 1368
   場所 ContentTypeTextNet.Pe.PeMain.UI.App.PauseOthers(Func`1 func) 場所 c:\Users\sk\Documents\Programming\c#\Pe\Pe\PeMain\UI\App.cs:行 1237
   場所 ContentTypeTextNet.Pe.PeMain.UI.App.&amp;lt;AttachmentMainMenu&amp;gt;b__3d(Object sender, EventArgs e) 場所 c:\Users\sk\Documents\Programming\c#\Pe\Pe\PeMain\UI\App.cs:行 779
   場所 System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   場所 System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   場所 System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   場所 System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   場所 System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   場所 System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   場所 System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   場所 System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   場所 System.Windows.Forms.Control.WmMouseUp(Message&amp;amp; m, MouseButtons button, Int32 clicks)
   場所 System.Windows.Forms.Control.WndProc(Message&amp;amp; m)
   場所 System.Windows.Forms.ScrollableControl.WndProc(Message&amp;amp; m)
   場所 System.Windows.Forms.ToolStrip.WndProc(Message&amp;amp; m)
   場所 System.Windows.Forms.ToolStripDropDown.WndProc(Message&amp;amp; m)
   場所 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp;amp; m)
   場所 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;amp; m)
   場所 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   場所 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp;amp; msg)
   場所 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   場所 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   場所 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   場所 System.Windows.Forms.Application.Run()
   場所 ContentTypeTextNet.Pe.PeMain.Logic.ApplicationRoot.Execute(String[] args) 場所 c:\Users\sk\Documents\Programming\c#\Pe\Pe\PeMain\Logic\ApplicationRoot.cs:行 60
   場所 ContentTypeTextNet.Pe.PeMain.Startup.Main(String[] args) 場所 c:\Users\sk\Documents\Programming\c#\Pe\Pe\PeMain\Main.cs:行 18
   場所 System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   場所 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   場所 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   場所 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   場所 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   場所 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   場所 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   場所 System.Threading.ThreadHelper.ThreadStart()</StackTrace><ExceptionString>System.NullReferenceException: オブジェクト参照がオブジェクト インスタンスに設定されていません。
   場所 ContentTypeTextNet.Pe.Library.Utility.TextUtility.ToUnique(String target, IEnumerable`1 list, Func`3 dg) 場所 c:\Users\sk\Documents\Programming\c#\Pe\Pe\Utility\TextUtility.cs:行 29
   場所 ContentTypeTextNet.Pe.PeMain.UI.SettingForm.ToolbarAddGroup(String groupName) 場所 c:\Users\sk\Documents\Programming\c#\Pe\Pe\PeMain\UI\SettingForm.cs:行 1452
   場所 ContentTypeTextNet.Pe.PeMain.UI.SettingForm.ToolToolbarGroup_addGroup_Click(Object sender, EventArgs e) 場所 c:\Users\sk\Documents\Programming\c#\Pe\Pe\PeMain\UI\SettingForm.cs:行 1619
   場所 System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   場所 System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
   場所 System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   場所 System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   場所 System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   場所 System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   場所 System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   場所 System.Windows.Forms.Control.WmMouseUp(Message&amp;amp; m, MouseButtons button, Int32 clicks)
   場所 System.Windows.Forms.Control.WndProc(Message&amp;amp; m)
   場所 System.Windows.Forms.ScrollableControl.WndProc(Message&amp;amp; m)
   場所 System.Windows.Forms.ToolStrip.WndProc(Message&amp;amp; m)
   場所 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp;amp; m)
   場所 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;amp; m)
   場所 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   場所 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp;amp; msg)
   場所 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   場所 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   場所 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   場所 System.Windows.Forms.Application.RunDialog(Form form)
   場所 System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   場所 System.Windows.Forms.Form.ShowDialog()
   場所 ContentTypeTextNet.Pe.PeMain.UI.App.OpenSettingDialog() 場所 c:\Users\sk\Documents\Programming\c#\Pe\Pe\PeMain\UI\App.cs:行 1368
   場所 ContentTypeTextNet.Pe.PeMain.UI.App.PauseOthers(Func`1 func) 場所 c:\Users\sk\Documents\Programming\c#\Pe\Pe\PeMain\UI\App.cs:行 1237
   場所 ContentTypeTextNet.Pe.PeMain.UI.App.&amp;lt;AttachmentMainMenu&amp;gt;b__3d(Object sender, EventArgs e) 場所 c:\Users\sk\Documents\Programming\c#\Pe\Pe\PeMain\UI\App.cs:行 779
   場所 System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   場所 System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   場所 System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   場所 System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   場所 System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   場所 System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   場所 System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   場所 System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   場所 System.Windows.Forms.Control.WmMouseUp(Message&amp;amp; m, MouseButtons button, Int32 clicks)
   場所 System.Windows.Forms.Control.WndProc(Message&amp;amp; m)
   場所 System.Windows.Forms.ScrollableControl.WndProc(Message&amp;amp; m)
   場所 System.Windows.Forms.ToolStrip.WndProc(Message&amp;amp; m)
   場所 System.Windows.Forms.ToolStripDropDown.WndProc(Message&amp;amp; m)
   場所 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp;amp; m)
   場所 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;amp; m)
   場所 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   場所 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp;amp; msg)
   場所 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   場所 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   場所 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   場所 System.Windows.Forms.Application.Run()
   場所 ContentTypeTextNet.Pe.PeMain.Logic.ApplicationRoot.Execute(String[] args) 場所 c:\Users\sk\Documents\Programming\c#\Pe\Pe\PeMain\Logic\ApplicationRoot.cs:行 60
   場所 ContentTypeTextNet.Pe.PeMain.Startup.Main(String[] args) 場所 c:\Users\sk\Documents\Programming\c#\Pe\Pe\PeMain\Main.cs:行 18
   場所 System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   場所 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   場所 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   場所 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   場所 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   場所 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   場所 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   場所 System.Threading.ThreadHelper.ThreadStart()</ExceptionString></Exception></TraceRecord>

Comments (6)

  1. Log in to comment