{"record":{"id":"dfb23c9823f9bd41","repo":"flxzt/rnote","slug":"affine-does-not-have-value-at-index-4","errorCode":null,"errorMessage":"affine does not have value at index 4","messagePattern":"affine does not have value at index 4","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/rnote-engine/src/fileformats/rnoteformat/maj0min15.rs","lineNumber":152,"sourceCode":"        \"affine\",\n        vec![\n            #[allow(clippy::get_first)]\n            affine\n                .get(0)\n                .cloned()\n                .ok_or(anyhow!(\"affine does not have value at index 0\"))?,\n            affine\n                .get(1)\n                .cloned()\n                .ok_or(anyhow!(\"affine does not have value at index 1\"))?,\n            affine\n                .get(3)\n                .cloned()\n                .ok_or(anyhow!(\"affine does not have value at index 3\"))?,\n            affine\n                .get(4)\n                .cloned()\n                .ok_or(anyhow!(\"affine does not have value at index 4\"))?,\n            affine\n                .get(6)\n                .cloned()\n                .ok_or(anyhow!(\"affine does not have value at index 6\"))?,\n            affine\n                .get(7)\n                .cloned()\n                .ok_or(anyhow!(\"affine does not have value at index 7\"))?,\n        ],\n    );\n\n    Ok(())\n}\n","sourceCodeStart":134,"sourceCodeEnd":166,"githubUrl":"https://github.com/flxzt/rnote/blob/bbc5354502ba2fc83eec2670b535348825e679a6/crates/rnote-engine/src/fileformats/rnoteformat/maj0min15.rs#L134-L166","documentation":"Index guard in convert_transform_to_affine_in_obj: the affine transform array stored on an object in the file being migrated is shorter than expected, so .get(4) (and similarly 0/1/3) returned None while rebuilding the affine matrix. Fires on .rnote files with truncated or malformed transform arrays.","triggerScenarios":"An .rnote file with an \"affine\" array of length 3 (has 0,1,3 but not 4) during the maj0min15 conversion.","commonSituations":"Truncated JSON from interrupted writes or a malformed custom exporter.","solutions":["Repair \"affine\" to contain all 8 elements, e.g. [1,0,0,1,0,0,0,1].","Restore from backup or re-export the document.","Fix the writer to serialize the complete matrix."],"exampleFix":"// before\n\"affine\": [1, 0, 0]\n// after\n\"affine\": [1, 0, 0, 1, 0, 0, 0, 1]","handlingStrategy":"validation","validationCode":"if affine.len() < 8 { return Err(\"affine matrix incomplete\".into()); }","typeGuard":"fn is_full_affine(a: &serde_json::Value) -> bool {\n    a.as_array().map(|a| a.len() >= 8).unwrap_or(false)\n}","tryCatchPattern":null,"preventionTips":["Validate matrix completeness before migration.","Use fixed-size serialization so partial matrices are impossible.","Re-export rather than repairing truncated files manually."],"tags":["json","file-migration","index-out-of-range"],"backgroundTag":"index-out-of-bounds","analyzedSha":"bbc5354502ba2fc83eec2670b535348825e679a6","analyzedAt":"2026-09-08T13:20:33.747Z","contentChangedAt":"2026-09-08T13:20:33.747Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}