{"record":{"id":"adce9c618c284549","repo":"alibaba/ARouter","slug":"no-postcard","errorCode":null,"errorMessage":"No postcard!","messagePattern":"No postcard!","errorType":"exception","errorClass":"NoRouteFoundException","httpStatus":null,"severity":"error","filePath":"arouter-api/src/main/java/com/alibaba/android/arouter/core/LogisticsCenter.java","lineNumber":274,"sourceCode":"            addRouteGroupDynamic(postcard.getGroup(), null);\n        } catch (Exception e) {\n            throw new HandlerException(\n                    TAG + \"Fatal exception when loading group meta. [\" + describeFailure(e) + \"]\",\n                    e\n            );\n        }\n\n        return Warehouse.routes.containsKey(postcard.getPath());\n    }\n\n    /**\n     * Completion the postcard by route metas\n     *\n     * @param postcard Incomplete postcard, should complete by this method.\n     */\n    public synchronized static void completion(Postcard postcard) {\n        if (null == postcard) {\n            throw new NoRouteFoundException(TAG + \"No postcard!\");\n        }\n\n        RouteMeta routeMeta = Warehouse.routes.get(postcard.getPath());\n        if (null == routeMeta) {\n            // Maybe its does't exist, or didn't load.\n            if (!Warehouse.groupsIndex.containsKey(postcard.getGroup())) {\n                throw new NoRouteFoundException(TAG + \"There is no route match the path [\" + postcard.getPath() + \"], in group [\" + postcard.getGroup() + \"]\");\n            } else {\n                // Load route and cache it into memory, then delete from metas.\n                try {\n                    if (ARouter.debuggable()) {\n                        logger.debug(TAG, String.format(Locale.getDefault(), \"The group [%s] starts loading, trigger by [%s]\", postcard.getGroup(), postcard.getPath()));\n                    }\n\n                    addRouteGroupDynamic(postcard.getGroup(), null);\n\n                    if (ARouter.debuggable()) {\n                        logger.debug(TAG, String.format(Locale.getDefault(), \"The group [%s] has already been loaded, trigger by [%s]\", postcard.getGroup(), postcard.getPath()));","sourceCodeStart":256,"sourceCodeEnd":292,"githubUrl":"https://github.com/alibaba/ARouter/blob/84f451d244e3fb1d0e37801de1b9ee2af2f81d68/arouter-api/src/main/java/com/alibaba/android/arouter/core/LogisticsCenter.java#L256-L292","documentation":"LogisticsCenter.completion() fills in a Postcard's route metadata; it throws NoRouteFoundException 'No postcard!' when handed a null Postcard. This is a fail-fast guard: navigation cannot proceed without a Postcard built via ARouter.build().","triggerScenarios":"Passing null to completion(), e.g. a navigation helper that builds a Postcard conditionally and forwards null when a path/group is empty.","commonSituations":"Custom navigation wrappers where build() result is assigned conditionally; refactored code where an earlier null check on the URI/path was removed.","solutions":["Ensure the Postcard comes from ARouter.getInstance().build(path) and is non-null before navigating","Null-check inputs in wrapper methods that derive the path from URIs or user data","Log and return early instead of forwarding a null Postcard to the navigation pipeline"],"exampleFix":"// before\nPostcard postcard = uri != null ? build(uri) : null;\nLogisticsCenter.completion(postcard); // NPE-style throw\n// after\nPostcard postcard = uri != null ? build(uri) : null;\nif (postcard != null) {\n    LogisticsCenter.completion(postcard);\n}","handlingStrategy":"type-guard","validationCode":"if (postcard == null) {\n    Log.w(TAG, \"no postcard built, skipping navigation\");\n    return;\n}","typeGuard":"boolean isValid(Postcard p) { return p != null && p.getPath() != null && !p.getPath().isEmpty(); }","tryCatchPattern":"try {\n    LogisticsCenter.completion(postcard);\n} catch (NoRouteFoundException e) {\n    Log.w(TAG, \"completion skipped: \" + e.getMessage());\n}","preventionTips":["Only build Postcards via ARouter.build() and null-check the result","Null-check path/URI inputs before building the postcard","Avoid conditional postcard construction in wrappers"],"tags":["arouter","navigation","null-argument"],"backgroundTag":"null-argument","analyzedSha":"84f451d244e3fb1d0e37801de1b9ee2af2f81d68","analyzedAt":"2026-09-06T13:30:41.084Z","contentChangedAt":"2026-09-06T13:30:41.084Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}