FMOD_ChannelGroup_GetChannel() private method

private FMOD_ChannelGroup_GetChannel ( IntPtr channelgroup, int index, IntPtr &channel ) : RESULT
channelgroup System.IntPtr
index int
channel System.IntPtr
return RESULT
        public RESULT getChannel(int index, ref Channel channel)
        {
            RESULT rESULT = RESULT.OK;
            IntPtr raw    = IntPtr.Zero;

            try
            {
                rESULT = ChannelGroup.FMOD_ChannelGroup_GetChannel(channelgroupraw, index, ref raw);
            }
            catch
            {
                rESULT = RESULT.ERR_INVALID_PARAM;
            }
            RESULT result;

            if (rESULT != RESULT.OK)
            {
                result = rESULT;
            }
            else
            {
                if (channel == null)
                {
                    Channel channel2 = new Channel();
                    channel2.setRaw(raw);
                    channel = channel2;
                }
                else
                {
                    channel.setRaw(raw);
                }
                result = rESULT;
            }
            return(result);
        }