{"record":{"id":"c610cc7efa168d89","repo":"beemdevelopment/Aegis","slug":"cannot-load-svg-from-stream","errorCode":null,"errorMessage":"Cannot load SVG from stream","messagePattern":"Cannot load SVG from stream","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/com/beemdevelopment/aegis/ui/glide/SvgDecoder.java","lineNumber":41,"sourceCode":"    @Override\n    public boolean handles(@NonNull InputStream source, @NonNull Options options) {\n        return options.get(VaultEntryIconLoader.ICON_TYPE) == IconType.SVG;\n    }\n\n    public Resource<SVG> decode(\n            @NonNull InputStream source, int width, int height, @NonNull Options options)\n            throws IOException {\n        try {\n            SVG svg = SVG.getFromInputStream(source);\n            if (width != SIZE_ORIGINAL) {\n                svg.setDocumentWidth(width);\n            }\n            if (height != SIZE_ORIGINAL) {\n                svg.setDocumentHeight(height);\n            }\n            return new SimpleResource<>(svg);\n        } catch (SVGParseException ex) {\n            throw new IOException(\"Cannot load SVG from stream\", ex);\n        }\n    }\n}\n","sourceCodeStart":23,"sourceCodeEnd":45,"githubUrl":"https://github.com/beemdevelopment/Aegis/blob/d6f4e5925a97e4e91593f1542085eae03432a759/app/src/main/java/com/beemdevelopment/aegis/ui/glide/SvgDecoder.java#L23-L45","documentation":"Wraps any exception from SVG.getFromInputStream (an IOException) while decoding an entry icon, signaling the stream does not contain a valid, parseable SVG document. It fires on corrupt, truncated, or mislabeled SVG icon data; callers propagate it as an IOException to Glide's decoding pipeline.","triggerScenarios":"Thrown at app/src/main/java/com/beemdevelopment/aegis/ui/glide/SvgDecoder.java:41 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wrap SVG.getFromInputStream in try-catch and propagate the IOException so Glide's decode pipeline reports the failure","Verify the stream is non-null and contains SVG markup (startsWith \"<svg\" or \"<?xml\") before calling SVG.getFromInputStream","Catch SVGParseException specifically and rethrow as IOException with context about the malformed resource","Log the raw bytes length read from the stream to confirm the icon data is not empty or truncated"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d6f4e5925a97e4e91593f1542085eae03432a759","analyzedAt":"2026-09-08T00:46:31.111Z","contentChangedAt":"2026-09-08T00:46:31.111Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}