Skip to content

Commit 358a45e

Browse files
committed
Merge remote-tracking branch 'origin/master-1.19-lts' into master-1.20-lts
2 parents 821dff7 + aa44cf7 commit 358a45e

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
As always, don't forget to backup your world before updating!
2+
Requires CyclopsCore version 1.19.0 or higher.
3+
4+
Fixes:
5+
* Fix infinite loop not being properly caught, Closes #28
6+

src/main/java/org/cyclops/integratedscripting/api/network/IScript.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package org.cyclops.integratedscripting.api.network;
22

3+
import org.cyclops.integrateddynamics.api.evaluate.EvaluationException;
4+
35
import javax.annotation.Nullable;
46

57
/**
@@ -14,7 +16,7 @@ public interface IScript {
1416
* @return The member, or null if it does not exist.
1517
*/
1618
@Nullable
17-
public IScriptMember getMember(String memberName);
19+
public IScriptMember getMember(String memberName) throws EvaluationException;
1820

1921
/**
2022
* Register a listener that will be invoked when this script gets invalidated.

src/main/java/org/cyclops/integratedscripting/core/network/GraalScript.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,13 @@ public GraalScript(Context graalContext, Value graalValue,
4545

4646
@Nullable
4747
@Override
48-
public IScriptMember getMember(String memberName) {
49-
Value member = this.graalValue.getMember(memberName);
48+
public IScriptMember getMember(String memberName) throws EvaluationException {
49+
Value member;
50+
try {
51+
member = this.graalValue.getMember(memberName);
52+
} catch (PolyglotException e) {
53+
throw ScriptHelpers.getEvaluationExceptionFactory(disk, path, memberName).createError(e.getMessage());
54+
}
5055
return member == null ? null : new GraalScript(this.graalContext, member, this.addInvalidationListener, this.removeInvalidationListener, disk, path, memberName);
5156
}
5257

0 commit comments

Comments
 (0)