Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
Lines without separator are now ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
Daw588 committed Nov 13, 2022
1 parent e7daca0 commit 77e9bf7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Compiler output is not needed on GitHub
/target

# Package manager output is not needed on GitHub
**/Cargo.lock

# Prevent leaking .config file that contains .ROBLOSECURITY
**/stateye.config
16 changes: 15 additions & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,21 @@ pub fn get_config() -> Config {
0 1
*/

let key_value = line.split_once("=").unwrap();
let split_line = line.split_once("=");
if split_line.is_none() {
/*
Skip over this line as it
does not have a separator.
This will prevent the program
from crashing when blank lines
are present in the config file.
*/
continue;
}

let key_value = split_line.unwrap();

let key = key_value.0;
let value = key_value.1;

Expand Down

0 comments on commit 77e9bf7

Please sign in to comment.