SWIG: protect against dereferencing a null pointer $1