Note that there are some explanatory texts on larger screens.

plurals
  1. POIronpython: Debugging a null reference exception
    primarykey
    data
    text
    <p>I have previously asked <a href="https://stackoverflow.com/questions/6712051/ironpython-function-works-in-cpython-mysterious-null-pointer-exception-in-ironp">this</a> question when I was seeing a null pointer exception. In that case it turned out that what I was seeing was in fact a bug in IronPython. </p> <p>Now I recently came across this error again when using a third party library (written in C#). The library is the <a href="http://dotspatial.codeplex.com/" rel="nofollow noreferrer">DotSpatial</a> library and it turns out that I accidentally created a condition in my IronPython code that led to a side effect in the DotSpatial method breaking. For reference the call and error message are:</p> <pre><code>&gt;&gt;&gt; myScheme.CreateCategories(myLayer.DataSet.DataTable) Traceback (most recent call last): File "&lt;stdin&gt;", line 1, in &lt;module&gt; SystemError: Object reference not set to an instance of an object. </code></pre> <p>This was particularly difficult to debug because the problem was not with the myScheme object or the DataTable I was passing to its method, but with another property of myScheme that I had set incorrectly, which I didn't even know that CreateCategories accessed.</p> <p>To figure out what was going wrong here I had to read through the DotSpatial <a href="http://dotspatial.codeplex.com/SourceControl/changeset/view/3f292a701a9d#DotSpatial.Symbology/DotSpatial.Symbology/FeatureScheme.cs" rel="nofollow noreferrer">source code</a>. While I don't have too much trouble doing that, I was wondering if there are any 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?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload