A plugin with invalid metadata (e.g. a plugin for testing #5383 loaded in a regular version) will cause a segfault when completing commands, because its state is nullptr. This adds a check for the state. There should probably a method like isLoaded or isEnabled or isEnabledAndLoaded that does these checks in the future, because currently, even disabled plugins will be checked for completions (they don't have any completion callback, so it's fine [for now]).
A plugin with invalid metadata (e.g. a plugin for testing #5383 loaded in a regular version) will cause a segfault when completing commands, because its state is
nullptr
. This adds a check for the state. There should probably a method likeisLoaded
orisEnabled
orisEnabledAndLoaded
that does these checks in the future, because currently, even disabled plugins will be checked for completions (they don't have any completion callback, so it's fine [for now]).