Handle null values when persisting
description
When persisting the WorkInProgressGroupColumn the SecondQuery will be null. This has to be handled better
System.NullReferenceException was unhandled
Message=Object reference not set to an instance of an object.
Source=Core
StackTrace:
at VisualWip.Core.PersistenceTree.AddChild[T](Expression1 property) in C:\src\VisualWIP\Dev\Core\PersistenceTree.cs:line 101
at VisualWip.Core.Columns.WorkDualQueryColumnBase.Persist(String name) in C:\src\VisualWIP\Dev\Core\Columns\WorkDualQueryColumnBase.cs:line 65
at VisualWip.Core.PersistenceTree.AddChildren[T](Expression1 property) in C:\src\VisualWIP\Dev\Core\PersistenceTree.cs:line 87
at VisualWip.Core.Application.Persist(String name) in C:\src\VisualWIP\Dev\Core\Application.cs:line 118
at VisualWip.Util.PersistanceProvider.GetPersistenceDocument(Application application) in C:\src\VisualWIP\Dev\Util\PersistanceProvider.cs:line 23
at VisualWip.Util.FilePersistanceProvider.Persist(Application application, SettingsPath settingsPath) in C:\src\VisualWIP\Dev\Util\FilePersistanceProvider.cs:line 20
at VisualWip.Core.Application.Save(SettingsPath settingsPath) in C:\src\VisualWIP\Dev\Core\Application.cs:line 162
at VisualWip.PresentationModel.MainWindowViewModel.SaveAs() in C:\src\VisualWIP\Dev\PresentationModel\ViewModels\MainWindowViewModel.cs:line 245
at VisualWip.PresentationModel.MainWindowViewModel.Save() in C:\src\VisualWIP\Dev\PresentationModel\ViewModels\MainWindowViewModel.cs:line 238
at VisualWip.PresentationModel.MainWindowViewModel.<get_SaveCommand>b__9(Object param) in C:\src\VisualWIP\Dev\PresentationModel\ViewModels\MainWindowViewModel.cs:line 99
at VisualWip.PresentationModel.RelayCommand.Execute(Object parameter) in C:\src\VisualWIP\Dev\PresentationModel\RelayCommand.cs:line 66
at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
at System.Windows.Controls.MenuItem.InvokeClickAfterRender(Object arg)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at VisualWip.App.Main() in C:\src\VisualWIP\Dev\VisualWip\obj\x86\Debug\App.g.cs:line 0
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: