{"record":{"id":"e8f6bdc6973ebe72","repo":"NationalSecurityAgency/ghidra","slug":"there-is-no-platform","errorCode":null,"errorMessage":"There is no platform","messagePattern":"There is no platform","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/flatapi/FlatDebuggerAPI.java","lineNumber":233,"sourceCode":"\t\tTracePlatform platform = getCurrentPlatform();\n\t\tif (platform == null) {\n\t\t\t// NB: Yes I've left off \"platform\"\n\t\t\t// It's less confusing, and if there's a trace, there's always a platform\n\t\t\tthrow new IllegalStateException(\"There is no current trace\");\n\t\t}\n\t\treturn platform;\n\t}\n\n\t/**\n\t * Require that the given platform is not null\n\t * \n\t * @param platform the platform\n\t * @return the platform\n\t * @throws IllegalStateException if the platform is null\n\t */\n\tdefault TracePlatform requirePlatform(TracePlatform platform) {\n\t\tif (platform == null) {\n\t\t\tthrow new IllegalStateException(\"There is no platform\");\n\t\t}\n\t\treturn platform;\n\t}\n\n\t/**\n\t * Get the current thread\n\t * \n\t * <p>\n\t * While uncommon, it is possible for there to be a current trace, but no current thread.\n\t * \n\t * @see #getCurrentDebuggerCoordinates()\n\t * @return the thread\n\t */\n\tdefault TraceThread getCurrentThread() {\n\t\treturn getTraceManager().getCurrentThread();\n\t}\n\n\t/**","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/flatapi/FlatDebuggerAPI.java#L215-L251","documentation":"Thrown by FlatDebuggerAPI.requirePlatform(platform) when the caller passes a null platform reference. This is a null-check guard for an explicitly supplied platform argument.","triggerScenarios":"Calling requirePlatform(somePlatform) where somePlatform is null, e.g., a platform obtained from a lookup or a different trace that returned null.","commonSituations":"Passing a platform reference that came from an uninitialized field or a failed lookup; deserialization/construction errors that leave platform null.","solutions":["Check the platform variable for null before calling requirePlatform().","Use getCurrentPlatform() if you meant the active platform.","Trace where the platform reference was assigned and handle the null case."],"exampleFix":"// before\nTracePlatform p = lookupPlatform(cfg); // may be null\nrequirePlatform(p); // throws\n\n// after\nTracePlatform p = lookupPlatform(cfg);\nif (p == null) {\n    println(\"No platform for config \" + cfg);\n    return;\n}","handlingStrategy":"validation","validationCode":"if (platform == null) {\n    println(\"Platform reference is null\");\n    return;\n}","typeGuard":"static boolean isNonNullPlatform(TracePlatform p) {\n    return p != null;\n}","tryCatchPattern":"try {\n    requirePlatform(platform);\n} catch (IllegalStateException e) {\n    if (e.getMessage().equals(\"There is no platform\")) {\n        platform = getCurrentPlatform();\n    } else throw e;\n}","preventionTips":["Null-check platform variables after the lookup that populated them.","Re-resolve platforms whenever the trace context changes."],"tags":["flat-debugger-api","platform","null-check","debugger"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}