Skip to content

Commit 0725ffd

Browse files
committed
Fix invalid language options wrapper.
1 parent 0f35d08 commit 0725ffd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/PythonOptions.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,11 @@ public int hashCode() {
368368

369369
@SuppressWarnings("unchecked")
370370
public <T> T get(OptionKey<T> optionKey) {
371-
return (T) engineOptions.get(optionKey);
371+
if (engineOptions.containsKey(optionKey)) {
372+
return (T) engineOptions.get(optionKey);
373+
} else {
374+
return optionKey.getDefaultValue();
375+
}
372376
}
373377

374378
public boolean hasBeenSet(OptionKey<?> optionKey) {

0 commit comments

Comments
 (0)