Zum Hauptinhalt gehen

Object reference not set to an instance of an object

Kommentare

12 Kommentare

  • Nico Burgerhart
    Does your FeatureSet contain geometry (Return Geometry is True on the Query Task)?

     

    Are there features in the FeatureSet (FeatureSet.Features.Any should return True)

     

    If you FeatureSet contains one point feature: a point has no extent.

     

    Does your FeatureSet return features (Return OIDs Only is False).

     

    Check the contents of the FeatureSet with the .ToJson method.
    0
  • Chris Bates
    Thanks for the reply Nico,

     

     

    Hopefully I can cover all of your points:

     

     

    1. QueryTask...Return Geometry = True

     

    2. QueryTask goes through a Flow Decision Node (FeatureSet.Features.Count = 0) 

     

     
    0
  • Chris Bates
    Argh, sorry I can't seem to end my post and i posted too early...

     

     

    2. QueryTask goes through a Flow Decision Node (FeatureSet.Features.Count = 0) 

     

             if True return No Features Found

     

             if False Select FeaturesSet

     

     

    3. The input feature class is a polygon only. No points.

     

     

    4. Can you elaborate on using the .ToJson method to check the contents of the FeatureSet?

     

     

    Thanks again
    0
  • Nico Burgerhart
    .ToJson returns a json representation of the featureset, you can use an alert activity to show the contents.
    0
  • Chris Bates
    Okay - great, the contents of the FeatureSet makes sense (contains the the correct information for the correct mapservice).
    0
  • Nico Burgerhart
    There is geometry in it? Because the issue should be in the geometry.
    0
  • Chris Bates
    Hi Nico - you were absolutely correct. The geometry was not coming across (The SHAPE@ fields were not visible in the ArcGIS Pro project that publishes the map service) So, that explains why the query task was able to return tabular information but returning a null value for geometry and then bombing when trying to get the extent info. 

     

     

    Thanks for you help. The .ToJSON method was very helpful in debugging the issue.
    0
  • Nico Burgerhart
    The OBJECTID is correctly filled?
    0
  • Permanently deleted user
    yes and the error appears when in the buffer tool,
    0
  • Permanently deleted user
    and when I drop the alert message I got the result.
    0
  • Nico Burgerhart
    Set Return Geometry on the Query Task to True.
    0
  • Permanently deleted user
    Thank you Nico for your help, it is already set to true, I could confirm that the issue is resolved by entering the service url instead of the layer url. This was my silly mistake!
    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.