ExecuteNullableQuery may return unusable object not null


In the code segment of ExecuteNullableQuery:
            //wqlQuery = FixWmiQueryString(wqlQuery);
            IResultObject obj = connection.QueryProcessor.ExecuteQuery(wqlQuery);
            if (obj != null)
                //LogLine(LogFile, "Query returned an object of type: " + obj.GetType().FullName, DebugEnabled);
                return obj;

            return null;
I find that the IResultObject returned may be not null since it may contain an additional ConnectionManager, even though the IResultObject contains no other useful result from the query. Perhaps we need to test this object a bit further before returning the useless object rather than the desirable "null" value.
Closed Dec 17, 2009 at 11:26 PM by rhearn


rhearn wrote Jun 3, 2009 at 2:00 AM


rhearn wrote Aug 28, 2009 at 12:20 AM

Need to modify the code to detect valid but empty IResultObjects returned form the query.

Added to SCIF 2.0 spec.

rhearn wrote Oct 29, 2009 at 9:11 PM

moved fix for this back to 1.x code base

wrote Dec 17, 2009 at 11:26 PM

Resolved with changeset 41448.

wrote Feb 13, 2013 at 11:45 PM

wrote May 16, 2013 at 6:21 AM