This repository has been archived by the owner. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
ShellTreeView.RefreshItem null reference exception #5
Comments
Could you try to create a minimal repro that exhibits this behaviour? It's not something I've seen before. |
Well the thing is that I don't know what triggers it, it happens randomly, but I think that it happend everytime app was minimized and running for some time, then when you bring it up it crashes. |
I managed to reproduce it, I also tried it with clean build, here are steps:
|
Ah! Indeed changing the OneDrive setting seems to trigger it. I need to take a look in more depth as to what is causing it, but it's Friday night here now so it will be next week (and I might not have much time then as I'll be on on a business trip :( ) |
No hurry, my browser is still in development 😆 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Something odd is happening randomly when running an app using ShellTreeView:
Null reference happens when
ShellItem folder = (ShellItem) node.Tag;
is acessed in RefreshItem(TreeNode node) because it's null
What is really strange is that second argument of FindItem(e.Item.Parent, m_TreeView.Nodes[0]);
m_TreeView.Nodes[0] is different when calling method and when passed to FindItem as you can see on the pictures below.
Another this that I don't understand is how is parent returned from FindItem if first arg is null and second doesn't have any nodes, really strange.
Here is details on few objects during debugging:
void m_ShellListener_ItemUpdated(object sender, ShellItemEventArgs e)
e.Item
{shell:///Desktop}
ComInterface: COM Object
DisplayName: "Desktop"
FileSystemPath: "C:\Users\username\Desktop"
HasSubFolders: true
IsFileSystem: true
IsFileSystemAncestor: true
IsFolder: true
IsReadOnly: false
m_ComInterface: COM Object
Parent: null
ParsingName: "C:\Users\username\Desktop"
Pidl: 83534968
ShellIcon: {(Icon)}
ToolTipText: ""
m_TreeView.Nodes[0]
{Text = "This PC"}
base: {Text = "This PC"}
BackColor: "{Name=0, ARGB=(0, 0, 0, 0)}"
Bounds: {X = 22 Y = -108 Width = 44 Height = 18}
Checked: false
ContextMenu: null
ContextMenuStrip: null
FirstNode: {Text = "Desktop"}
ForeColor: "{Name=0, ARGB=(0, 0, 0, 0)}"
FullPath: "This PC"
Handle: 83754648
ImageIndex: -1
ImageKey: ""
Index: 0
IsEditing: false
IsExpanded: true
IsSelected: false
IsVisible: false
LastNode: {Text = "DVD RW Drive (F:)"}
Level: 0
Name: ""
NextNode: null
NextVisibleNode: {Text = "Desktop"}
NodeFont: null
Nodes: {System.Windows.Forms.TreeNodeCollection}
Parent: null
PrevNode: null
PrevVisibleNode: null
SelectedImageIndex: -1
SelectedImageKey: ""
StateImageIndex: -1
StateImageKey: ""
Tag: {shell:///MyComputerFolder}
Text: "This PC"
ToolTipText: ""
TreeView: {System.Windows.Forms.TreeView, Nodes.Count: 1, Nodes[0]: TreeNode: This PC}
parent
{Text = ""}
base: {Text = ""}
BackColor: "{Name=0, ARGB=(0, 0, 0, 0)}"
Bounds: {X = 0 Y = 0 Width = 0 Height = 0}
Checked: false
ContextMenu: null
ContextMenuStrip: null
FirstNode: null
ForeColor: "{Name=0, ARGB=(0, 0, 0, 0)}"
FullPath: "This PC\Desktop"
Handle: 83752416
ImageIndex: -1
ImageKey: ""
Index: 0
IsEditing: false
IsExpanded: false
IsSelected: false
IsVisible: false
LastNode: null
Level: 2
Name: ""
NextNode: null
NextVisibleNode: {Text = "Documents"}
NodeFont: null
Nodes: {System.Windows.Forms.TreeNodeCollection}
Parent: {Text = "Desktop"}
PrevNode: null
PrevVisibleNode: {Text = "This PC"}
SelectedImageIndex: -1
SelectedImageKey: ""
StateImageIndex: -1
StateImageKey: ""
Tag: null
Text: ""
ToolTipText: ""
TreeView: {System.Windows.Forms.TreeView, Nodes.Count: 1, Nodes[0]: TreeNode: This PC}
TreeNode FindItem(ShellItem item, TreeNode parent)
parent
{Text = ""}
base: {Text = ""}
BackColor: "{Name=0, ARGB=(0, 0, 0, 0)}"
Bounds: {X = 0 Y = 0 Width = 0 Height = 0}
Checked: false
ContextMenu: null
ContextMenuStrip: null
FirstNode: null
ForeColor: "{Name=0, ARGB=(0, 0, 0, 0)}"
FullPath: "This PC\Desktop"
Handle: 83752416
ImageIndex: -1
ImageKey: ""
Index: 0
IsEditing: false
IsExpanded: false
IsSelected: false
IsVisible: false
LastNode: null
Level: 2
Name: ""
NextNode: null
NextVisibleNode: {Text = "Documents"}
NodeFont: null
Nodes: {System.Windows.Forms.TreeNodeCollection}
Parent: {Text = "Desktop"}
PrevNode: null
PrevVisibleNode: {Text = "This PC"}
SelectedImageIndex: -1
SelectedImageKey: ""
StateImageIndex: -1
StateImageKey: ""
Tag: null
Text: ""
ToolTipText: ""
TreeView: {System.Windows.Forms.TreeView, Nodes.Count: 1, Nodes[0]: TreeNode: This PC}
The text was updated successfully, but these errors were encountered: