bordemstirs
Member
Working on a rather tedious proof of concept script that has to file_to_map itself, and I was getting an Unexpected Error. I thought maybe I wasn't allowed to load files from non-/data directories (though I thought at one time I was) so I moved a copy into /data. Same error. After a bunch of toying around and using a very simple script (just file_to_map) and a very simple data file (2 lines) I was able to narrow down the issue: whenever the file I'm requesting has a .ash extension I get a debug log, even if the file doesn't exist (however a non-existing .txt file works just fine). Even using the same file and just changing the name would get the error (or lack thereof, when the extension is not ash.)
Code:
Unexpected error, debug log printed.
class java.lang.NullPointerException: null
java.lang.NullPointerException
at net.sourceforge.kolmafia.textui.DataFileCache.getBytes(DataFileCache.java:166)
at net.sourceforge.kolmafia.textui.DataFileCache.getReader(DataFileCache.java:158)
at net.sourceforge.kolmafia.textui.RuntimeLibrary.file_to_map(RuntimeLibrary.java:4917)
at net.sourceforge.kolmafia.textui.RuntimeLibrary.file_to_map(RuntimeLibrary.java:4908)
at sun.reflect.GeneratedMethodAccessor68.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.sourceforge.kolmafia.textui.parsetree.LibraryFunction.execute(LibraryFunction.java:115)
...