# Fitting Histograms :: null pointer error

**URL:** <https://root-forum.cern.ch/t/fitting-histograms-null-pointer-error/38440>\
**Category:** ROOT\
**Created:** [March 17, 2020, 6:03pm UTC](https://root-forum.cern.ch/t/fitting-histograms-null-pointer-error/38440 "2020-03-17T18:03:39Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [March 19, 2020, 8:47am UTC](https://root-forum.cern.ch/t/fitting-histograms-null-pointer-error/38440/9 "2020-03-19T08:47:57Z")

</div>

Well, try to add “`gPad->Modifed(); gPad->Update();`” right before “`gPad->AddExec(...);`”.

[If you are using Mac OS X with Cocoa, maybe you need to add one or two calls “`gSystem->ProcessEvents();`” after each “`some_pad_or_canvas->Update();`”.](https://root-forum.cern.ch/t/canvas-will-not-show/27582/10)

If it doesn’t help, maybe @couet has some idea.

---

_[View the full topic](https://root-forum.cern.ch/t/fitting-histograms-null-pointer-error/38440)._
