NationalSecurityAgency/ghidra · error · IllegalStateException
There is no platform
Error message
There is no platform
What it means
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.
Source
Thrown at Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/flatapi/FlatDebuggerAPI.java:233
TracePlatform platform = getCurrentPlatform();
if (platform == null) {
// NB: Yes I've left off "platform"
// It's less confusing, and if there's a trace, there's always a platform
throw new IllegalStateException("There is no current trace");
}
return platform;
}
/**
* Require that the given platform is not null
*
* @param platform the platform
* @return the platform
* @throws IllegalStateException if the platform is null
*/
default TracePlatform requirePlatform(TracePlatform platform) {
if (platform == null) {
throw new IllegalStateException("There is no platform");
}
return platform;
}
/**
* Get the current thread
*
* <p>
* While uncommon, it is possible for there to be a current trace, but no current thread.
*
* @see #getCurrentDebuggerCoordinates()
* @return the thread
*/
default TraceThread getCurrentThread() {
return getTraceManager().getCurrentThread();
}
/**View on GitHub (pinned to d5f144c24d)
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.
Example fix
// before
TracePlatform p = lookupPlatform(cfg); // may be null
requirePlatform(p); // throws
// after
TracePlatform p = lookupPlatform(cfg);
if (p == null) {
println("No platform for config " + cfg);
return;
} Defensive patterns
Strategy: validation
Validate before calling
if (platform == null) {
println("Platform reference is null");
return;
} Type guard
static boolean isNonNullPlatform(TracePlatform p) {
return p != null;
} Try / catch
try {
requirePlatform(platform);
} catch (IllegalStateException e) {
if (e.getMessage().equals("There is no platform")) {
platform = getCurrentPlatform();
} else throw e;
} Prevention
- Null-check platform variables after the lookup that populated them.
- Re-resolve platforms whenever the trace context changes.
When it happens
Trigger: Calling requirePlatform(somePlatform) where somePlatform is null, e.g., a platform obtained from a lookup or a different trace that returned null.
Common situations: Passing a platform reference that came from an uninitialized field or a failed lookup; deserialization/construction errors that leave platform null.
Related errors
- There is no trace
- There is no thread
- Given platform is not from the current trace
- Register {} is not in language {}
- Tool does not have service {cls}! This script should be run
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/e8f6bdc6973ebe72.
Report an issue: GitHub.