Skip to content

Commit

Permalink
fixed an issue where toLowerCase can be called on undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherBThai committed Apr 1, 2022
1 parent 3668133 commit ff38cee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/commands/commandList/battle/util/rerollUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ async function applyChange(p, weapon){
function parseArgs(p){
/* Parse reroll type and weapon id */
let rrType, uwid;
if(passiveArray.includes(p.args[1].toLowerCase())){
if(passiveArray.includes(p.args[1]?.toLowerCase())){
rrType = "p";
uwid = p.args[2];
}else if(passiveArray.includes(p.args[2].toLowerCase())){
}else if(passiveArray.includes(p.args[2]?.toLowerCase())){
rrType = "p";
uwid = p.args[1];
}else if(statArray.includes(p.args[1].toLowerCase())){
}else if(statArray.includes(p.args[1]?.toLowerCase())){
rrType = "s";
uwid = p.args[2];
}else if(statArray.includes(p.args[2].toLowerCase())){
}else if(statArray.includes(p.args[2]?.toLowerCase())){
rrType = "s";
uwid = p.args[1];
}else{
Expand Down

0 comments on commit ff38cee

Please sign in to comment.