Skip to content

Commit a7ee686

Browse files
authored
Merge branch 'Stack-Programing-Community:main' into main
2 parents 73276e5 + 3214f49 commit a7ee686

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ The powerful script language designed with a stack oriented approach for efficie
33

44
![image](https://github.com/Stack-Programing-Community/Stack-Programing-Language/assets/122075081/5d7ff479-731b-4def-808a-12dc5301a7a1)
55

6-
## Installation
6+
## Install
77

88
### If you don't want to install...
99

src/main.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,15 @@ impl Executor {
10351035
for item in &mut class.to_owned()[1..class.len()].iter() {
10361036
let mut item = item.to_owned();
10371037
if item.get_list().len() == 1 {
1038-
let element = &data[index];
1038+
let element = match data.get(index) {
1039+
Some(value) => value,
1040+
None => {
1041+
self.log_print(format!("Error! initial data is shortage\n"));
1042+
self.stack
1043+
.push(Type::Error("instance-shortage".to_string()));
1044+
return;
1045+
}
1046+
};
10391047
object.insert(
10401048
item.get_list()[0].to_owned().get_string(),
10411049
element.to_owned(),

0 commit comments

Comments
 (0)