Skip to content

Commit b40dde4

Browse files
FrottyCopilot
andauthored
Update de.peeeq.wurstscript/src/main/java/de/peeeq/wurstscript/translation/imtranslation/StackTraceInjector2.java
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 7e0bedc commit b40dde4

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

de.peeeq.wurstscript/src/main/java/de/peeeq/wurstscript/translation/imtranslation/StackTraceInjector2.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,10 @@ private void addStackTracePush(Multimap<ImFunction, ImFunctionCall> calls, Set<I
159159
private ImExpr getStackPosVar(ImFunction f) {
160160
for (ImVar imVar : f.getParameters()) {
161161
if (isStackTraceParam(imVar)) {
162-
return JassIm.ImVarAccess(Optional.of(imVar).orElseGet(() -> {
163-
throw new CompileError(f, "Function " + f.getName() + " has no stacktrace parameter.");
164-
}));
162+
return JassIm.ImVarAccess(imVar);
165163
}
166164
}
167-
return JassIm.ImVarAccess(Optional.<ImVar>empty().orElseGet(() -> {
168-
throw new CompileError(f, "Function " + f.getName() + " has no stacktrace parameter.");
169-
}));
165+
throw new CompileError(f, "Function " + f.getName() + " has no stacktrace parameter.");
170166
}
171167

172168
/**

0 commit comments

Comments
 (0)