Skip to content

Commit 4a990ae

Browse files
committed
fix NPE
1 parent d0cc993 commit 4a990ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

graalpython/com.oracle.graal.python.shell/src/com/oracle/graal/python/shell/GraalPythonMain.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ private void evalNonInteractive(Context context) throws IOException {
491491
} catch (IOException e) {
492492
}
493493
File f = new File(inputFile);
494-
if (f.isDirectory() || mimeType.equals("application/zip")) {
494+
if (f.isDirectory() || (mimeType != null && mimeType.equals("application/zip"))) {
495495
String runMod = String.format("import sys; sys.path.insert(0, '%s'); import runpy; runpy._run_module_as_main('__main__', False)", inputFile);
496496
src = Source.newBuilder(getLanguageId(), runMod, "<string>").build();
497497
} else {

0 commit comments

Comments
 (0)