mirror of
https://codeberg.org/icewind/php-literal-parser.git
synced 2026-06-03 10:34:08 +02:00
fix index panicking when using int index
This commit is contained in:
parent
9fc78fed41
commit
7a98bf4825
1 changed files with 1 additions and 1 deletions
|
|
@ -463,7 +463,7 @@ impl Index<i64> for Value {
|
||||||
|
|
||||||
fn index(&self, index: i64) -> &Self::Output {
|
fn index(&self, index: i64) -> &Self::Output {
|
||||||
match self {
|
match self {
|
||||||
Value::Array(map) => map.index(&Key::Int(index)),
|
Value::Array(map) => map.get(&Key::Int(index)).unwrap_or(&Value::Null),
|
||||||
_ => &Value::Null,
|
_ => &Value::Null,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue