halo-dev/halo · warning · IllegalArgumentException
Plugin name must not be blank
Error message
Plugin name must not be blank
What it means
Thrown as IllegalArgumentException by DefaultPluginGetter.getPlugin when the supplied name is null, empty, or whitespace-only. The getter fetches a Plugin by name from the ExtensionClient; a blank name is a programmer error, not a not-found condition (not-found yields NotFoundException separately).
Source
Thrown at application/src/main/java/run/halo/app/plugin/DefaultPluginGetter.java:24
import run.halo.app.core.extension.Plugin;
import run.halo.app.extension.ExtensionClient;
import run.halo.app.infra.exception.NotFoundException;
/**
* Default implementation of {@link PluginGetter}.
*
* @author guqing
* @since 2.17.0
*/
@Component
@RequiredArgsConstructor
public class DefaultPluginGetter implements PluginGetter {
private final ExtensionClient client;
@Override
public Plugin getPlugin(String name) {
if (StringUtils.isBlank(name)) {
throw new IllegalArgumentException("Plugin name must not be blank");
}
return client.fetch(Plugin.class, name).orElseThrow(() -> new NotFoundException("Plugin not found"));
}
}
View on GitHub (pinned to d2f5165f9c)
Solutions
- Validate the name is non-blank before calling getPlugin and return 400 if it is.
- Ensure the caller always supplies a populated plugin identifier.
- Check upstream that the variable resolving the name is not null/empty.
Example fix
// before
Plugin p = pluginGetter.getPlugin(req.getName()); // name null
// after
if (!StringUtils.hasText(req.getName())) {
throw new ServerWebInputException("plugin name is required");
}
Plugin p = pluginGetter.getPlugin(req.getName()); Defensive patterns
Strategy: validation
Validate before calling
if (!StringUtils.hasText(name)) {
throw new ServerWebInputException("Plugin name is required");
}
Plugin p = pluginGetter.getPlugin(name); Type guard
static boolean isNonBlankPluginName(String s) {
return s != null && !s.trim().isEmpty();
} Try / catch
try {
pluginGetter.getPlugin(name);
} catch (IllegalArgumentException e) {
throw new ServerWebInputException("Plugin name must not be blank", null, e);
} catch (NotFoundException e) {
return ServerResponse.notFound().build();
} Prevention
- Validate path variables / request fields for non-blank plugin names at the controller boundary.
- Never pass uninitialized or null name variables through to the getter.
- Return 400 for blank input and 404 for unknown plugins separately.
When it happens
Trigger: Calling pluginGetter.getPlugin(name) with a blank/null name: an unvalidated request path variable, a missing form field, or a programmatic caller passing an uninitialized variable.
Common situations: A controller/endpoint forwarding an empty path variable; a frontend omitting the plugin name; a null returned from a lookup that is passed straight through; defensive code missing before delegating.
Related errors
- Illegal requires version expression.
- Invalid attachment
- User permissions not set in PermissionUtils
- ESM provider manifest must be an object.
- ESM provider manifest must contain format, entry, and option
AI-assisted analysis of halo-dev/halo@d2f5165f9c (2026-08-14).
Data as JSON: /api/errors/769e84438bd12d96.
Report an issue: GitHub.