I previously asked this question when I saw a null pointer exception. In this case, it turned out that what I saw was actually a bug in IronPython.
Now, I recently encountered this error when using a third-party library (written in C #). The library is a DotSpatial library, and it turns out that I accidentally created a condition in my IronPython code, which led to a side effect in Violating the DotSpatial method. For reference message and error message:
>>> myScheme.CreateCategories(myLayer.DataSet.DataTable) Traceback (most recent call last): File "<stdin>", line 1, in <module> SystemError: Object reference not set to an instance of an object.
This was especially difficult to debug, because the problem was not that the myScheme or DataTable object that I passed it to the method, but with the other myScheme property that I set incorrectly, that I did not even know that the CreateCategories had access.
To understand what was going on here, I had to read the source code of DotSpatial . While I have no particular problems with this, I was wondering if there are easier ways to debug such an error? Or am I stuck with bad error messages because I'm working with IronPython and a third-party library?
source share