bryce-harrington / T-Notes

Note-keeping database application
0 stars 0 forks source link

removeEmpty() utilized for keywords causes error when utilizing addNote() #34

Closed findhamza closed 5 years ago

findhamza commented 5 years ago

Connecting to MySQL... Exception thrown: 'System.ArgumentOutOfRangeException' in mscorlib.dll System.Transactions Critical: 0 : http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/UnhandledUnhandled exceptionTNotes.exeSystem.ArgumentOutOfRangeException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) at System.Collections.Generic.List1.get_Item(Int32 index) at System.Linq.Enumerable.ElementAt[TSource](IEnumerable1 source, Int32 index) at SQLInterface.removeEmpty(List1 tokens) in C:\Users\Hamza\source\repos\Draemondor\T-Notes\TNotes\TNotes\SQLInterface.cs:line 502 at SQLInterface.removeGarbage(List1 tokens) in C:\Users\Hamza\source\repos\Draemondor\T-Notes\TNotes\TNotes\SQLInterface.cs:line 465 at SQLInterface.tokenize(String body) in C:\Users\Hamza\source\repos\Draemondor\T-Notes\TNotes\TNotes\SQLInterface.cs:line 542 at SQLInterface.addNote(String note_title, Int32 chapter, Int32 section, String date, String summary, String body, Int32 user_id, Int32 course_id) in C:\Users\Hamza\source\repos\Draemondor\T-Notes\TNotes\TNotes\SQLInterface.cs:line 667 at TNotes.User.addNotes(String title, Int32 chapter, Int32 section, String summary, String body, Int32 course_id) in C:\Users\Hamza\source\repos\Draemondor\T-Notes\TNotes\TNotes\User.cs:line 105 at TNotes.Dashboard.buttonSave_Click(Object sender, EventArgs e) in C:\Users\Hamza\source\repos\Draemondor\T-Notes\TNotes\TNotes\Dashboard.cs:line 211 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(Form mainForm) at TNotes.Form1.<button1_Click>b__10_0() in C:\Users\Hamza\source\repos\Draemondor\T-Notes\TNotes\TNotes\Login.cs:line 61 at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) at System.Collections.Generic.List1.get_Item(Int32 index) at System.Linq.Enumerable.ElementAt[TSource](IEnumerable1 source, Int32 index) at SQLInterface.removeEmpty(List1 tokens) in C:\Users\Hamza\source\repos\Draemondor\T-Notes\TNotes\TNotes\SQLInterface.cs:line 502 at SQLInterface.removeGarbage(List1 tokens) in C:\Users\Hamza\source\repos\Draemondor\T-Notes\TNotes\TNotes\SQLInterface.cs:line 465 at SQLInterface.tokenize(String body) in C:\Users\Hamza\source\repos\Draemondor\T-Notes\TNotes\TNotes\SQLInterface.cs:line 542 at SQLInterface.addNote(String note_title, Int32 chapter, Int32 section, String date, String summary, String body, Int32 user_id, Int32 course_id) in C:\Users\Hamza\source\repos\Draemondor\T-Notes\TNotes\TNotes\SQLInterface.cs:line 667 at TNotes.User.addNotes(String title, Int32 chapter, Int32 section, String summary, String body, Int32 course_id) in C:\Users\Hamza\source\repos\Draemondor\T-Notes\TNotes\TNotes\User.cs:line 105 at TNotes.Dashboard.buttonSave_Click(Object sender, EventArgs e) in C:\Users\Hamza\source\repos\Draemondor\T-Notes\TNotes\TNotes\Dashboard.cs:line 211 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(Form mainForm) at TNotes.Form1.<button1_Click>b__10_0() in C:\Users\Hamza\source\repos\Draemondor\T-Notes\TNotes\TNotes\Login.cs:line 61 at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll Index was out of range. Must be non-negative and less than the size of the collection.

'TNotes.exe' (CLR v4.0.30319: TNotes.exe): Loaded 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\PrivateAssemblies\Runtime\Microsoft.VisualStudio.Debugger.Runtime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. The program '[18260] TNotes.exe' has exited with code -1 (0xffffffff).

ChandlorRatcliffe commented 5 years ago

Fixed in https://github.com/Draemondor/T-Notes/commit/db68d5bf1451cfb7d18f5c8b42a96186f545c96d