getErrorMsg and getErrorMessage

Check in getErrorMsg and getErrorMessage for NULL *char pointer