This is to avoid nil pointer dereference when method by pointer reference and method by value reference are implemented. Fixes #8387