1

Closed

ExecuteNullableQuery may return unusable object not null

description

In the code segment of ExecuteNullableQuery:
 
        try
        {
            //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 10:26 PM by rhearn

comments

rhearn wrote Jun 3, 2009 at 1:00 AM

investigating...

rhearn wrote Aug 27, 2009 at 11:20 PM

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 8:11 PM

moved fix for this back to 1.x code base

wrote Dec 17, 2009 at 10:26 PM

Resolved with changeset 41448.

wrote Feb 13, 2013 at 10:45 PM

wrote May 16, 2013 at 5:21 AM