Avoid GC segfault when ->class null