Another check for instance != NULL before unref (fix 8 for NB#126941)