NPE on dispose
(cherry picked from commit 2f813a3)