diff --git a/site_ansto/hardsup/nhq200util.c b/site_ansto/hardsup/nhq200util.c index dbc7e8a4..73b418d7 100644 --- a/site_ansto/hardsup/nhq200util.c +++ b/site_ansto/hardsup/nhq200util.c @@ -271,6 +271,9 @@ int NHQ200_Setup(pNHQ200 self, int iControl) /* Operations common to both Open a char pCommand[20]; char pReply[132]; + if (!self || !self->controller || !self->controller->pSock) + return NHQ200__BADCOM; + /* MJL enable RS232 debugging mode. */ setRS232Debug(self->controller,1); printf("***RS232 debug mode enabled for NHQ200***\n");fflush(stdout);