Fix a wrong check for NULL

If `new` fails it won't return NULL but will throw an exception