{"record":{"id":"faa63e85e5d18359","repo":"stride3d/stride","slug":"value","errorCode":null,"errorMessage":"value","messagePattern":"value","errorType":"validation","errorClass":"ArgumentOutOfRangeException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Input/Gestures/GestureConfig.cs","lineNumber":52,"sourceCode":"\n            restrictedNumberOfFinger = numberOfFinger;\n        }\n\n        /// <summary>\n        /// This value represents the required number of simultaneous finger to tap to trigger the gesture. For example: 1 for single finger, and so on...\n        /// </summary>\n        /// <remarks>This value is strictly positive.</remarks>\n        /// <exception cref=\"ArgumentOutOfRangeException\">The given value is not in the allowed range.</exception>\n        /// <exception cref=\"InvalidOperationException\">Tried to modify the configuration after it has been frozen by the system.</exception>\n        public int RequiredNumberOfFingers\n        {\n            get { return requiredNumberOfFingers; }\n            set\n            {\n                CheckNotFrozen();\n\n                if (value < 1)\n                    throw new ArgumentOutOfRangeException(\"value\");\n\n                if (restrictedNumberOfFinger != 0 && value != restrictedNumberOfFinger)\n                    throw new ArgumentOutOfRangeException(\"value\");\n\n                requiredNumberOfFingers = value;\n            }\n        }\n        private int requiredNumberOfFingers;\n\n        /// <summary>\n        /// Indicate that the configuration is frozen and cannot be modified anymore by the user.\n        /// </summary>\n        private bool frozen;\n\n        /// <summary>\n        /// Freeze the configuration so that the user cannot modify it anymore.\n        /// </summary>\n        private void Freeze()","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Input/Gestures/GestureConfig.cs#L34-L70","documentation":"GestureConfig.RequiredNumberOfFingers validates the assigned value: it must be at least 1, and if the config was created with a restricted number of fingers, it must equal that restriction. Violating either throws ArgumentOutOfRangeException with parameter name 'value'.","triggerScenarios":"Assigning RequiredNumberOfFingers = 0 or a negative number; or assigning a count that differs from restrictedNumberOfFinger when the config was built for a fixed finger count (e.g. a two-finger pinch config given 3).","commonSituations":"Initializing gesture settings from serialized config where the default int value 0 leaks into the property; configuring a specific gesture (pinch/rotate) with a finger count other than its required one.","solutions":["Set RequiredNumberOfFingers to 1 or more","Match the restricted finger count for gesture configs that require an exact count (e.g. 2 for pinch)","Validate deserialized config values before assigning them"],"exampleFix":"// before\ngestureConfig.RequiredNumberOfFingers = fingersFromConfig; // may be 0\n// after\ngestureConfig.RequiredNumberOfFingers = Math.Max(1, fingersFromConfig);","handlingStrategy":"validation","validationCode":"if (fingerCount >= 1)\n    config.RequiredNumberOfFingers = fingerCount;","typeGuard":null,"tryCatchPattern":"try { config.RequiredNumberOfFingers = v; }\ncatch (ArgumentOutOfRangeException) { config.RequiredNumberOfFingers = 1; }","preventionTips":["Clamp deserialized values to >= 1 before assignment","Document which gestures require exact finger counts","Initialize configs in code rather than relying on default(int)"],"tags":["input","gestures","config","validation"],"backgroundTag":"value-out-of-range","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}