From c4f4ea358dc9d511895ec39a22cea4f4ef46319c Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Wed, 17 Jan 2007 09:43:33 +1100 Subject: [PATCH] robustness r1402 | dcl | 2007-01-17 09:43:33 +1100 (Wed, 17 Jan 2007) | 2 lines --- site_ansto/hardsup/nhq200util.c | 3 +++ 1 file changed, 3 insertions(+) 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);