Skip to content

Commit

Permalink
Fix null check for opcode in parser switch statement
Browse files Browse the repository at this point in the history
Signed-off-by: worksofliam <[email protected]>
  • Loading branch information
worksofliam committed Dec 6, 2024
1 parent 5af9a3f commit bda3061
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion language/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,7 @@ export default class Parser {

potentialName = cSpec.factor1 ? cSpec.factor1.value : ``;

switch (cSpec.opcode.value) {
switch (cSpec.opcode && cSpec.opcode.value) {
case `BEGSR`:
if (!scope.subroutines.find(sub => sub.name && sub.name.toUpperCase() === potentialName)) {
currentItem = new Declaration(`subroutine`);
Expand Down

0 comments on commit bda3061

Please sign in to comment.