Fix potential null pointer dereference in src/classdef.cpp

This PR fixes Coverity ID 49897 (Dereference before null c).

Best regards and many thanks

Martin Ettl