From fe49cfae675e529bf5306eb93fe5d3f6a4b5f653 Mon Sep 17 00:00:00 2001 From: Ron Sluiter Date: Thu, 29 Apr 2010 14:08:19 +0000 Subject: [PATCH] More error checks to prevent IOC crashing when controller powered-down. --- motorApp/AerotechSrc/drvEnsembleAsyn.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/motorApp/AerotechSrc/drvEnsembleAsyn.cc b/motorApp/AerotechSrc/drvEnsembleAsyn.cc index dbd65565..aa5e7a79 100755 --- a/motorApp/AerotechSrc/drvEnsembleAsyn.cc +++ b/motorApp/AerotechSrc/drvEnsembleAsyn.cc @@ -287,7 +287,7 @@ static int motorAxisClose(AXIS_HDL pAxis) static int motorAxisGetInteger(AXIS_HDL pAxis, motorAxisParam_t function, int * value) { - if (pAxis == NULL) + if (pAxis == NULL || pAxis->params == NULL) return (MOTOR_AXIS_ERROR); else return (motorParam->getInteger(pAxis->params, (paramIndex) function, value)); @@ -295,7 +295,7 @@ static int motorAxisGetInteger(AXIS_HDL pAxis, motorAxisParam_t function, int * static int motorAxisGetDouble(AXIS_HDL pAxis, motorAxisParam_t function, double * value) { - if (pAxis == NULL) + if (pAxis == NULL || pAxis->params == NULL) return (MOTOR_AXIS_ERROR); else return (motorParam->getDouble(pAxis->params, (paramIndex) function, value)); @@ -303,7 +303,7 @@ static int motorAxisGetDouble(AXIS_HDL pAxis, motorAxisParam_t function, double static int motorAxisSetCallback(AXIS_HDL pAxis, motorAxisCallbackFunc callback, void * param) { - if (pAxis == NULL) + if (pAxis == NULL || pAxis->params == NULL) return (MOTOR_AXIS_ERROR); else return (motorParam->setCallback(pAxis->params, callback, param));