{"record":{"id":"e59b7647832f66b0","repo":"wasabeef/android-gpuimage","slug":"r-must-not-be-null","errorCode":null,"errorMessage":"r must not be null","messagePattern":"r must not be null","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"library/src/main/java/jp/co/cyberagent/android/gpuimage/GLTextureView.java","lineNumber":1613,"sourceCode":"                        Thread.currentThread().interrupt();\n                    }\n                }\n            }\n        }\n\n        public void requestReleaseEglContextLocked() {\n            shouldReleaseEglContext = true;\n            glThreadManager.notifyAll();\n        }\n\n        /**\n         * Queue an \"event\" to be run on the GL rendering thread.\n         *\n         * @param r the runnable to be run on the GL rendering thread.\n         */\n        public void queueEvent(Runnable r) {\n            if (r == null) {\n                throw new IllegalArgumentException(\"r must not be null\");\n            }\n            synchronized (glThreadManager) {\n                eventQueue.add(r);\n                glThreadManager.notifyAll();\n            }\n        }\n\n        // Once the thread is started, all accesses to the following member\n        // variables are protected by the glThreadManager monitor\n        private boolean shouldExit;\n        private boolean exited;\n        private boolean requestPaused;\n        private boolean paused;\n        private boolean hasSurface;\n        private boolean surfaceIsBad;\n        private boolean waitingForSurface;\n        private boolean haveEglContext;\n        private boolean haveEglSurface;","sourceCodeStart":1595,"sourceCodeEnd":1631,"githubUrl":"https://github.com/wasabeef/android-gpuimage/blob/ceea576ec931c2968431ad46f1fb2e6d68a542e2/library/src/main/java/jp/co/cyberagent/android/gpuimage/GLTextureView.java#L1595-L1631","documentation":"GLTextureView.queueEvent(Runnable) requires a non-null runnable to schedule on the GL rendering thread. A null argument throws IllegalArgumentException(\"r must not be null\") before the event is added to the internal event queue.","triggerScenarios":"Calling glTextureView.queueEvent(null), typically when a Runnable field or callback is null (not yet initialized, already consumed, or a failed lookup) and passed without a check.","commonSituations":"A lazily-initialized runnable is still null when the view becomes available; a listener returning null on some paths; race conditions where a cleanup routine nulled the runnable before the UI scheduled it.","solutions":["Check for null before calling queueEvent and skip the call when there is nothing to run.","Initialize or re-create the Runnable before scheduling it on the GL thread.","Centralize GL-thread scheduling in a helper that no-ops on null runnables."],"exampleFix":"// before\n glTextureView.queueEvent(pendingTask);\n// after\n if (pendingTask != null) {\n     glTextureView.queueEvent(pendingTask);\n }","handlingStrategy":"type-guard","validationCode":"if (task == null) return; // nothing to schedule","typeGuard":"boolean canQueue(Runnable r) { return r != null; }","tryCatchPattern":null,"preventionTips":["Null-check runnables before scheduling on the GL thread","Avoid nullable Runnable fields; use no-op defaults","Wrap GL-thread posting in a helper that skips nulls"],"tags":["android","gpuimage","opengl","null-argument"],"backgroundTag":"null-argument","analyzedSha":"ceea576ec931c2968431ad46f1fb2e6d68a542e2","analyzedAt":"2026-09-11T16:56:13.742Z","contentChangedAt":"2026-09-11T16:56:13.742Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}