(c backend) Fix possible NullPointerException