if (queries[i] != null)
if (queries[i] != null && queries[i] instanceof IQueryDefinition)
		public void visitExtendedItem( ExtendedItemDesign item )		{			//create user-defined generation-time helper object			ExtendedItemHandle handle = (ExtendedItemHandle) item.getHandle( );			String tagName = handle.getExtensionName( );			// TODO: check in plugin registry whetherthe needQuery property is			// set to host or item.			// Only do the following for "host"			IReportItemQuery itemQuery = ExtensionManager.getInstance( )					.createQueryItem( tagName );			IBaseQueryDefinition[] queries = null;			IBaseQueryDefinition parentQuery = getParentQuery( );			if ( itemQuery != null )			{				try				{					itemQuery.setModelObject( handle );					queries = itemQuery.getReportQueries( parentQuery );									}				catch ( BirtException ex )				{					logger.log(Level.WARNING, ex.getMessage(), ex);				}				if ( queries != null )				{					item.setQueries(queries);					for ( int i = 0; i < queries.length; i++ )					{						if (queries[i] != null)						{							this.queries.add( queries[i] );						}					}					if (queries.length > 0)					{						IBaseQueryDefinition query = queries[0];						if (query != null)						{							item.setQuery( query );							pushQuery( query );							pushExpressions( query.getRowExpressions( ) );							handleReportItemExpressions( item );							// handleActionExpressions(item.getAction());							popExpressions( );							popQuery( );						}					}				}			}		}