Fix for #1030 uncaught error after grid destroyed (test)