Fix a bug in ClassOf which crashes Pcbnew when its argument is NULL. It fixes bug  #1329364.