[Mono-bugs] [Bug 74753][Nor] New - GroupCollection is invalid when using an empty Regex.Match input string

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 27 Apr 2005 16:53:48 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by eto@shaw.ca.

http://bugzilla.ximian.com/show_bug.cgi?id=74753

--- shadow/74753	2005-04-27 16:53:48.000000000 -0400
+++ shadow/74753.tmp.23687	2005-04-27 16:53:48.000000000 -0400
@@ -0,0 +1,45 @@
+Bug#: 74753
+Product: Mono: Class Libraries
+Version: 1.1
+OS: GNU/Linux [Other]
+OS Details: gentoo
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: eto@shaw.ca               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: GroupCollection is invalid when using an empty Regex.Match input string
+
+Description of Problem:
+If you pass an empty string to Regex.Match, and then try to get a Group
+from the Match returned, an Exception is thrown.  Runs fine in MS.NET
+
+Steps to reproduce the problem:
+1. Unzip attached example
+2. Run it
+3. Watch it barf
+
+Actual Results:
+An exception is thrown:
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object 
+in <0x000a9> System.Text.RegularExpressions.GroupCollection:get_Item
+(System.String groupName)
+
+Expected Results:
+Everything works fine
+
+How often does this happen? 
+Every time
+
+Additional Information:
+Looks like the group's Regex property isn't being set when it is being
+added to the collection.  Couldn't find exactly where that was occuring
+from a cursory look at the code.  Might look into it a little deeper to
+find the problem if I have time.