mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Make the null-result case visible to the user
Fixes #1303. (cherry picked from commit 83438644dcdc470517f67c0d55ff4889f71cc435)
This commit is contained in:
parent
ee3a30d582
commit
3426e0103b
@ -34,8 +34,6 @@ import java.time.Instant;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compiles and evaluates expressions.
|
* Compiles and evaluates expressions.
|
||||||
*
|
*
|
||||||
@ -122,7 +120,9 @@ public class Expression {
|
|||||||
Instant deadline = Instant.now().plusMillis(timeout);
|
Instant deadline = Instant.now().plusMillis(timeout);
|
||||||
// evaluation exceptions are thrown out of this method
|
// evaluation exceptions are thrown out of this method
|
||||||
Double result = compiledExpression.execute(new ExecutionData(slots, functions, deadline));
|
Double result = compiledExpression.execute(new ExecutionData(slots, functions, deadline));
|
||||||
checkNotNull(result, "Expression must result in a value");
|
if (result == null) {
|
||||||
|
throw new EvaluationException(-1, "Expression must result in a value");
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user