From 116dfc7070b3ab0e71ed74e2315d5277f367beff Mon Sep 17 00:00:00 2001 From: Bertrand Bellenot <Bertrand.Bellenot@cern.ch> Date: Wed, 25 Aug 2010 17:33:26 +0000 Subject: [PATCH] - Add missing variable initialisations - Add protections against possible null pointers. This should fix the bug #71758: DoubleClicked(NULL) called by TGFileBrowser::Update (https://savannah.cern.ch/bugs/?71758) git-svn-id: http://root.cern.ch/svn/root/trunk@35020 27541ba8-7e3a-0410-8455-c3a389f83636 --- gui/gui/src/TGFileBrowser.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gui/gui/src/TGFileBrowser.cxx b/gui/gui/src/TGFileBrowser.cxx index 3a1de8a308e..b73b2d48c63 100644 --- a/gui/gui/src/TGFileBrowser.cxx +++ b/gui/gui/src/TGFileBrowser.cxx @@ -200,6 +200,9 @@ void TGFileBrowser::CreateBrowser() fRootDir = 0; fDir = 0; fFile = 0; + fNKeys = 0; + fCnt = 0; + TString gv = gEnv->GetValue("Browser.GroupView", "1000"); Int_t igv = atoi(gv.Data()); if (igv > 10) @@ -612,6 +615,7 @@ void TGFileBrowser::Update() TGListTreeItem *item = fCurrentDir; TObject *selected = 0; if (!item) item = fRootDir; + if (!item) return; //fListTree->DeleteChildren(item); TGListTreeItem *curr = fListTree->GetSelected(); // GetCurrent() ?? if (curr) { @@ -786,6 +790,7 @@ void TGFileBrowser::ApplyFilter(Int_t id) TGListTreeItem *item = fCurrentDir; if (!item) item = fRootDir; + if (!item) return; fListTree->DeleteChildren(item); DoubleClicked(item, 1); //fListTree->AdjustPosition(item); -- GitLab