{"record":{"id":"822957fae2e4be76","repo":"microg/GmsCore","slug":"no-frame-supplied","errorCode":null,"errorMessage":"No frame supplied.","messagePattern":"No frame supplied\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"play-services-vision/src/main/java/com/google/android/gms/vision/barcode/BarcodeDetector.java","lineNumber":46,"sourceCode":" * <p>\n * Recognition results are returned by {@link #detect(Frame)} as Barcode instances.\n */\n@PublicApi\npublic class BarcodeDetector extends Detector<Barcode> {\n    private INativeBarcodeDetector remote;\n\n    private BarcodeDetector(INativeBarcodeDetector remote) {\n        this.remote = remote;\n    }\n\n    /**\n     * Recognizes barcodes in the supplied {@link Frame}.\n     *\n     * @return mapping of int to {@link Barcode}, where the int domain represents an opaque ID for the barcode. Identical barcodes (as determined by their raw value) will have the same ID across frames.\n     */\n    @Override\n    public SparseArray<Barcode> detect(Frame frame) {\n        if (frame == null) throw new IllegalArgumentException(\"No frame supplied.\");\n        SparseArray<Barcode> result = new SparseArray<>();\n        if (remote != null) {\n            FrameMetadataParcel metadataParcel = frame.getMetadata().createParcel();\n            Barcode[] barcodes = null;\n            if (frame.getBitmap() != null) {\n                try {\n                    barcodes = remote.detectBitmap(ObjectWrapper.wrap(frame.getBitmap()), metadataParcel);\n                } catch (RemoteException e) {\n                    // Ignore\n                }\n            } else {\n                try {\n                    barcodes = remote.detectBytes(ObjectWrapper.wrap(frame.getGrayscaleImageData()), metadataParcel);\n                } catch (RemoteException e) {\n                    // Ignore\n                }\n            }\n            if (barcodes != null) {","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/play-services-vision/src/main/java/com/google/android/gms/vision/barcode/BarcodeDetector.java#L28-L64","documentation":"BarcodeDetector.detect(Frame) requires a frame to analyze: a null Frame argument fails the Preconditions.checkNotNull check and throws IllegalArgumentException with this message before barcode recognition runs.","triggerScenarios":"Thrown at play-services-vision/src/main/java/com/google/android/gms/vision/barcode/BarcodeDetector.java:46 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Null-check the Frame before calling detect()","Skip detection when the camera/callback produced no frame"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"157c9d86ac46c195a86c2f15ab55c84036223f95","analyzedAt":"2026-09-06T17:27:33.892Z","contentChangedAt":"2026-09-06T17:27:33.892Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}