GDQuest / GDQuest/learn-gdscript
Lesson 25.2: Crashes when I use assertions (assert())
Open
bug
- Dominant language
- GDScript
- Stars
- 2.8k
- Forks
- 235
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
I just added two assertions in my code for exhaustiveness and editor printed this error:
```
Oh no! The script has an error, but the Script Verifier did not catch it
```
**To Reproduce**
Run this code:
```gdscript
func add_item(item_name, amount):
assert(!item_name.empty())
assert(amount > 0)
inventory[item_name] += amount
```
**Expected behavior**
I expected no error raised
For more informations, have a look at [this log file](https://github.com/GDQuest/learn-gdscript/files/10273192/gdquest-1671576382305.log).
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.