{"record":{"id":"47722846cc17ea3e","repo":"emilk/egui","slug":"layoutjob-has-no-sections","errorCode":null,"errorMessage":"LayoutJob has no sections","messagePattern":"LayoutJob has no sections","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/epaint/src/text/text_layout_types.rs","lineNumber":230,"sourceCode":"            return;\n        }\n\n        self.sections.push(LayoutSection {\n            leading_space,\n            byte_range,\n            format,\n        });\n    }\n\n    /// The [`TextFormat`] of the section containing the character starting at the given byte index.\n    ///\n    /// If the index is past the end, the format of the last section is returned.\n    ///\n    /// Panics if the job has no sections.\n    /// Assumes [`LayoutJob::sections`] are ordered by increasing `byte_range` (as produced by [`Self::append`]).\n    pub fn format_at_byte(&self, byte_idx: ByteIndex) -> &TextFormat {\n        self.debug_sanity_check();\n        let last = self.sections.last().expect(\"LayoutJob has no sections\");\n        let idx = self\n            .sections\n            .partition_point(|section| section.byte_range.end <= byte_idx);\n        let section = self.sections.get(idx).unwrap_or(last);\n        &section.format\n    }\n\n    /// Check the [`Self::sections`] invariant: the sections are ordered and together\n    /// cover the whole of [`Self::text`] with no gaps and no overlaps.\n    ///\n    /// Only does anything in debug builds.\n    #[cfg_attr(not(debug_assertions), expect(clippy::unused_self))]\n    pub fn debug_sanity_check(&self) {\n        #[cfg(debug_assertions)]\n        {\n            if self.sections.is_empty() {\n                assert!(\n                    self.text.is_empty(),","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/emilk/egui/blob/d802a982ce959839d92f4f6718fdffa41143110e/crates/epaint/src/text/text_layout_types.rs#L212-L248","documentation":"Error \"LayoutJob has no sections\" thrown in emilk/egui.","triggerScenarios":"Thrown at crates/epaint/src/text/text_layout_types.rs:230 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d802a982ce959839d92f4f6718fdffa41143110e","analyzedAt":"2026-08-16T20:07:53.954Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}