Repository: microsoft/garnet
File: libs/server/Resp/Objects/SetCommands.cs (C#)

Code before:
                keys[i - 1] = parseState.GetArgSliceByRef(i);
            }

            var status = storageApi.SetIntersectStore(keyBytes, keys, out var output);
            switch (status)
            {
                case GarnetStatus.OK:
                    while (!RespWriteUtils.WriteInteger(output, ref dcurr, dend))
                        SendAndReset();
                    break;
                case GarnetStatus.WRONGTYPE:
                    while (!RespWriteUtils.WriteError(CmdStrings.RESP_ERR_WRONG_TYPE, ref dcurr, dend))
                        SendAndReset();
                    break;
            }

            return true;
        }

        /// <summary>
        /// Returns the cardinality of the intersection between multiple sets.
        /// </summary>
        /// <param name="storageApi"></param>
        /// <typeparam name="TGarnetApi"></typeparam>
        /// <returns></returns>
        private bool SetIntersectCard<TGarnetApi>(ref TGarnetApi storageApi)
            where TGarnetApi : IGarnetApi
        {
            if (parseState.Count < 2) // Need at least numkeys + 1 key
            {
                return AbortWithWrongNumberOfArguments(nameof(RespCommand.SINTERCARD));
            }

            // Number of keys
            if (!parseState.TryGetInt(0, out var nKeys))
            {
                while (!RespWriteUtils.WriteError(CmdStrings.RESP_ERR_GENERIC_VALUE_IS_NOT_INTEGER, ref dcurr, dend))
                    SendAndReset();
                return true;
            }

            var keys = new ArgSlice[nKeys];
            int? limit = null;

            if ((parseState.Count - 1) < nKeys)
            {
                while (!RespWriteUtils.WriteError(CmdStrings.RESP_SYNTAX_ERROR, ref dcurr, dend))
                    SendAndReset();
                return true;
            }


Review comment (suggestion):
Can you test, the --no-obj option and see if it does not produce any errors?
Check Common.cs:ThrowObjectStoreUninitializedException to see how we use it

Code after:
            {
                keys[i - 1] = parseState.GetArgSliceByRef(i);
            }

            var status = storageApi.SetIntersectStore(keyBytes, keys, out var output);
            switch (status)
            {
                case GarnetStatus.OK:
                    while (!RespWriteUtils.WriteInteger(output, ref dcurr, dend))
                        SendAndReset();
                    break;
                case GarnetStatus.WRONGTYPE:
                    while (!RespWriteUtils.WriteError(CmdStrings.RESP_ERR_WRONG_TYPE, ref dcurr, dend))
                        SendAndReset();
                    break;
            }

            return true;
        }

        /// <summary>
        /// Returns the cardinality of the intersection between multiple sets.
        /// </summary>
        /// <param name="storageApi"></param>
        /// <typeparam name="TGarnetApi"></typeparam>
        /// <returns></returns>
        private bool SetIntersectLength<TGarnetApi>(ref TGarnetApi storageApi)
            where TGarnetApi : IGarnetApi
        {
            if (parseState.Count < 2) // Need at least numkeys + 1 key
            {
                return AbortWithWrongNumberOfArguments(nameof(RespCommand.SINTERCARD));
            }

            // Number of keys
            if (!parseState.TryGetInt(0, out var nKeys))
            {
                return AbortWithErrorMessage(CmdStrings.RESP_ERR_GENERIC_VALUE_IS_NOT_INTEGER);
            }

            if ((parseState.Count - 1) < nKeys)
            {
                return AbortWithErrorMessage(Encoding.ASCII.GetBytes(string.Format(CmdStrings.GenericErrShouldBeGreaterThanZero, "numkeys")));
            }

            var keys = parseState.Parameters.Slice(1, nKeys);

            // Optional LIMIT argument
            int? limit = null;
            if (parseState.Count > nKeys + 1)
            {