Bug 6144 - Editing textbox to add a document type causes errors
Summary: Editing textbox to add a document type causes errors
Status: RESOLVED DUPLICATE of bug 6559
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: iOS add-in ()
Version: 3.0.x
Hardware: PC Mac OS
: --- major
Target Milestone: ---
Assignee: Alan McGovern
URL:
Depends on:
Blocks:
 
Reported: 2012-07-16 14:35 UTC by PJ
Modified: 2012-08-16 11:48 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 6559

Description PJ 2012-07-16 14:35:24 UTC
Steps:
Create new iOS project
Go to Project Options->iPhone Application->Advanced Tab
Under Document Types, click Add Document Type
Select the 'Type:' field and enter some characters.


Expected result: user should be able to type into the text box

Actual result: http://screencast.com/t/W0CXfXa4GqT


Reported against:
MD 3.0.3.2
MT 5.2.12




First exception:


System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object
  at MonoDevelop.MacDev.PlistEditor.CustomPropertiesWidget.FindOrAddPObject (TreeIter iter, System.String id, MonoDevelop.MacDev.PlistEditor.PObject item, System.Collections.Generic.Dictionary`2 tree) [0x000e9] in /Users/builder/data/lanes/monodevelop-mac-monodevelop-3.0.3-branch/a2a2f108/source/monodevelop/main/src/addins/MonoDevelop.MacDev/MonoDevelop.MacDev.PlistEditor/CustomPropertiesWidget.cs:529 
  at MonoDevelop.MacDev.PlistEditor.CustomPropertiesWidget.AddToTree (Gtk.TreeStore treeStore, TreeIter iter, MonoDevelop.MacDev.PlistEditor.PObject current, System.Collections.Generic.Dictionary`2 tree) [0x00018] in /Users/builder/data/lanes/monodevelop-mac-monodevelop-3.0.3-branch/a2a2f108/source/monodevelop/main/src/addins/MonoDevelop.MacDev/MonoDevelop.MacDev.PlistEditor/CustomPropertiesWidget.cs:488 
  at MonoDevelop.MacDev.PlistEditor.CustomPropertiesWidget.AddToTree (Gtk.TreeStore treeStore, TreeIter iter, MonoDevelop.MacDev.PlistEditor.PObject current, System.Collections.Generic.Dictionary`2 tree) [0x00030] in /Users/builder/data/lanes/monodevelop-mac-monodevelop-3.0.3-branch/a2a2f108/source/monodevelop/main/src/addins/MonoDevelop.MacDev/MonoDevelop.MacDev.PlistEditor/CustomPropertiesWidget.cs:489 
  at MonoDevelop.MacDev.PlistEditor.CustomPropertiesWidget.RefreshTree () [0x0002c] in /Users/builder/data/lanes/monodevelop-mac-monodevelop-3.0.3-branch/a2a2f108/source/monodevelop/main/src/addins/MonoDevelop.MacDev/MonoDevelop.MacDev.PlistEditor/CustomPropertiesWidget.cs:573 
  at MonoDevelop.MacDev.PlistEditor.CustomPropertiesWidget.<SetPListContainer>m__16 (System.Object , System.EventArgs ) [0x00000] in /Users/builder/data/lanes/monodevelop-mac-monodevelop-3.0.3-branch/a2a2f108/source/monodevelop/main/src/addins/MonoDevelop.MacDev/MonoDevelop.MacDev.PlistEditor/CustomPropertiesWidget.cs:84 
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_EventArgs (object,System.EventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_EventArgs (object,System.EventArgs)
  at MonoDevelop.MacDev.PlistEditor.PObject.OnChanged (System.EventArgs e) [0x00019] in /Users/builder/data/lanes/monodevelop-mac-monodevelop-3.0.3-branch/a2a2f108/source/monodevelop/main/src/addins/MonoDevelop.MacDev/MonoDevelop.MacDev.PlistEditor/PListObject.cs:186 
  at MonoDevelop.MacDev.PlistEditor.PObject.OnChanged (System.EventArgs e) [0x0002c] in /Users/builder/data/lanes/monodevelop-mac-monodevelop-3.0.3-branch/a2a2f108/source/monodevelop/main/src/addins/MonoDevelop.MacDev/MonoDevelop.MacDev.PlistEditor/PListObject.cs:189 
  at MonoDevelop.MacDev.PlistEditor.PArray.AssignStringList (System.String strList) [0x00064] in /Users/builder/data/lanes/monodevelop-mac-monodevelop-3.0.3-branch/a2a2f108/source/monodevelop/main/src/addins/MonoDevelop.MacDev/MonoDevelop.MacDev.PlistEditor/PListObject.cs:723 
  at MonoDevelop.IPhone.PlistEditor.DocumentTypeWidget+<DocumentTypeWidget>c__AnonStorey2B.<>m__4A (System.Object , System.EventArgs ) [0x0002d] in /Users/builder/data/lanes/monodevelop-mac-monodevelop-3.0.3-branch/a2a2f108/source/md-addins/MonoDevelop.IPhone/MonoDevelop.IPhone/PlistEditor/DocumentTypeWidget.cs:89 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x000d5] in /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/corlib/System.Reflection/MonoMethod.cs:226 
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x000eb] in /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/corlib/System.Reflection/MonoMethod.cs:234 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/corlib/System.Reflection/MethodBase.cs:96 
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x000bf] in /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/corlib/System/Delegate.cs:408 
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00018] in /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/corlib/System/MulticastDelegate.cs:70 
  at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/corlib/System/Delegate.cs:382 
  at GLib.Signal.ClosureInvokedCB (System.Object o, GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0 
  at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0 
  at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) [0x00000] in <filename unknown>:0 



Subsequent exceptions:


System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[MonoDevelop.MacDev.PlistEditor.PObject,MonoDevelop.MacDev.PlistEditor.PListScheme+SchemaItem].get_Item (MonoDevelop.MacDev.PlistEditor.PObject key) [0x000a8] in /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:150 
  at MonoDevelop.MacDev.PlistEditor.PListScheme.AvailableValues (MonoDevelop.MacDev.PlistEditor.PObject obj, System.Collections.Generic.Dictionary`2 tree) [0x000ec] in /Users/builder/data/lanes/monodevelop-mac-monodevelop-3.0.3-branch/a2a2f108/source/monodevelop/main/src/addins/MonoDevelop.MacDev/MonoDevelop.MacDev.PlistEditor/PListScheme.cs:187 
  at MonoDevelop.MacDev.PlistEditor.CustomPropertiesWidget+<CustomPropertiesWidget>c__AnonStorey5.<>m__15 (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, TreeModel tree_model, TreeIter iter) [0x00097] in /Users/builder/data/lanes/monodevelop-mac-monodevelop-3.0.3-branch/a2a2f108/source/monodevelop/main/src/addins/MonoDevelop.MacDev/MonoDevelop.MacDev.PlistEditor/CustomPropertiesWidget.cs:318 
  at GtkSharp.TreeCellDataFuncWrapper.NativeCallback (IntPtr tree_column, IntPtr cell, IntPtr tree_model, IntPtr iter, IntPtr data) [0x00000] in <filename unknown>:0
Comment 1 Jeffrey Stedfast 2012-07-18 13:52:55 UTC
Somehow the treeview.Selection object is becoming null but I can't figure out how that's even possible.

Maybe Mike will have a better idea since this is his code?
Comment 2 Mike Krüger 2012-07-19 02:17:49 UTC
I just wrote it initially, that part is from alan. I don't think that the line numbers match anymore - line 529 in CustomPropertiesWidget.cs shouldn't produce a null ref exception.

Therefore it may already be fixed.
Comment 3 Jeffrey Stedfast 2012-08-07 18:28:30 UTC
Mike: I've stepped through this with a debugger and it's not fixed and the treeview.Selection really is null.
Comment 4 PJ 2012-08-07 18:30:28 UTC
I just tested the latest built MD from master and I still see the issue: MD 3.1.0 d0edcdd4355025459bf328a8693c7d85e06cdfdc
Comment 5 Jeffrey Stedfast 2012-08-16 11:48:21 UTC

*** This bug has been marked as a duplicate of bug 6559 ***