fix: handle NaN/undefined variable in integer comparisons

Wrap int(var_value) in __eval_basiccondition() with try/except to
prevent ValueError crash when a variable is undefined, empty, or
contains non-numeric text. In warn mode the comparison evaluates to
false; in stop mode a PPPInterrupt is raised with a descriptive message.
This commit is contained in:
Brandon Wallace
2026-03-19 01:28:24 -05:00
parent 3409909b05
commit cad7a52ed0
3 changed files with 16 additions and 13 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ With this prompt: `__quality__, 1girl, ${head:__eyes__, __hair__, __expression__
### General settings
* **Debug level**: what to write to the console. Note: in *SD.Next* debug messages only show if you launch it with the `--debug` argument.
* **What to do on invalid content warnings?**: warn on the console or stop the generation.
* **What to do on invalid content warnings?**: warn on the console or stop the generation. This also affects integer comparisons with undefined or non-numeric variables: in *warn* mode the comparison evaluates to false, in *stop* mode the generation is stopped with an error.
* **Model variant definitions**: definitions for model variants to be recognized based on strings found in the full filename.
The format for each line is (with *kind* being one of the base model identifiers or not defined):