I've spent some time looking at this. In general I've not foudn a problem with it. There are a few areas where some more context being passed around will help (Darkcyde pointed out that adding context to the 'Entered normal space' event might help) but in general there are three areas that might cause problems.
The first is that the context variables might not be set. You can check these in the Touchdown event to confirm that they are present and correct, or just read them out.
The second is that the BodyDetails() might not return an object. This would be because the data isn't available. The easiest way to check this is to run a 'SystemDetails()' and then loop through the name of each body in the bodies array to see if the body you want is present.
The third is that the BodyDetails() does return an object but does not have material details. This should be relatively easy to spot, because you will be able to use reportbody.name but not reportbody.materials.
If you could let me know which systems and bodies you've tried this on I can take a closer look at the database. Also, were these previously discovered systems or did you discover them yourself? And if the latter, did you use a DSS to scan them?
The first is that the context variables might not be set. You can check these in the Touchdown event to confirm that they are present and correct, or just read them out.
The second is that the BodyDetails() might not return an object. This would be because the data isn't available. The easiest way to check this is to run a 'SystemDetails()' and then loop through the name of each body in the bodies array to see if the body you want is present.
The third is that the BodyDetails() does return an object but does not have material details. This should be relatively easy to spot, because you will be able to use reportbody.name but not reportbody.materials.
If you could let me know which systems and bodies you've tried this on I can take a closer look at the database. Also, were these previously discovered systems or did you discover them yourself? And if the latter, did you use a DSS to scan them?