> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kodeflowstudios.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Flag Errors (FLG)

> Errors raised by FlagHandler when flag keys or lists are missing or empty.

Flag errors come from `FlagHandler` when a flag operation is called with missing input. They indicate a contract violation at the call site rather than a problem with stored flag state.

## FLG01

**`SetFlag` or `ToggleFlag` called with null or empty string.**

A flag operation requires a non-empty key. The call was made with `null`, `""`, or whitespace.

**Common causes**

* A flag name was read from a config or save file before being initialized.
* The caller forwarded an unchecked external value.
* A constant or enum-to-string conversion produced an empty string.

**Fix**
Validate the flag key before calling. Use a constant or shared identifier source so flag names are never empty.

**Thrown by**

* [KodeFlowStudios.Parley.FlagHandling.FlagHandler.SetFlag(string)](/parlite/reference/scripting/flag-handling/flag-handler#setflag-string)
* [KodeFlowStudios.Parley.FlagHandling.FlagHandler.ToggleFlag(string)](/parlite/reference/scripting/flag-handling/flag-handler#toggleflag-string)

## FLG02

**`SetFlags` called with null or empty list.**

The bulk-set operation was called with no flags to set. The call has no effect and is treated as an error.

**Common causes**

* A loader returned an empty collection without raising its own error.
* The caller built the list conditionally and produced an empty result.

**Fix**
Skip the call when the list is empty, or populate the list before calling.

**Thrown by**

* [KodeFlowStudios.Parley.FlagHandling.FlagHandler.SetFlags(List\<string>)](/parlite/reference/scripting/flag-handling/flag-handler#setflags-list\<string>)

## FLG03

**`ClearFlags` called with null or empty list.**

The bulk-clear operation was called with no flags to clear.

**Common causes**

* A reset routine ran before its flag list was populated.
* An empty collection was passed in by mistake.

**Fix**
Skip the call when the list is empty, or use the parameterless clear-all method if you intend to clear every flag.

**Thrown by**

* [KodeFlowStudios.Parley.FlagHandling.FlagHandler.ClearFlags(List\<string>)](/parlite/reference/scripting/flag-handling/flag-handler#clearflags-list\<string>)
