FillRandom doesn't accept a histogram

Basically, I do:

f = ROOT.TFile("MyFile.root")
myhist = f.Get("MyHist")
newhist = ROOT.TH1F("newhist","newhist",100,0.,40.)
newhist.FillRandom(myhist,5000)

And it complains:

Hi,

does myhist point to a valid histogram? From the looks of it, it’s a null pointer (print it or do “not not myhist”).

Cheers,
Wim