Skip to content

Commit 16e2811

Browse files
committed
refactor and more load security
1 parent 25cf58b commit 16e2811

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

TreeViewPanelExtension/TreePanel.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ public class TreePanel : IFiddlerExtension
5959
#region "Methods"
6060

6161
/// <summary>
62-
/// Default constructor
62+
/// Method to initialize all components
6363
/// </summary>
64-
public TreePanel()
64+
public void Initialize()
6565
{
6666
this.ShowPanel = false; // Default
6767

@@ -309,9 +309,16 @@ public void OnLoad()
309309
{
310310
// Locate the original sessions listview
311311
lvSessions = FiddlerApplication.UI.pnlSessions.Controls[Constants.ListViewName] as SessionListView;
312-
FiddlerApplication.UI.pnlSessions.SizeChanged += new EventHandler(pnlSessions_SizeChanged);
312+
if (lvSessions == null)
313+
{
314+
MessageBox.Show("Unable to locate original sessions panel.", Constants.RegistryExtensionKeyName);
315+
return;
316+
}
317+
318+
this.Initialize();
313319

314320
lvSessions.Invalidated += LvSessions_Invalidated;
321+
FiddlerApplication.UI.pnlSessions.SizeChanged += new EventHandler(pnlSessions_SizeChanged);
315322

316323
// Create our TreeView
317324
tv = new CustomTreeView

0 commit comments

Comments
 (0)