Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/QbXml/QbXml.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Author>Jean-Sébastien Goupil</Author>
<Authors>Jean-Sébastien Goupil</Authors>
<Copyright>Copyright © Jean-Sébastien Goupil 2015-2021</Copyright>
<Version>3.0.1</Version>
<Version>3.0.2</Version>
<AssemblyName>QbSync.QbXml</AssemblyName>
<RootNamespace>QbSync.QbXml</RootNamespace>
<PackageId>QbSync.QbXml</PackageId>
Expand Down
13 changes: 8 additions & 5 deletions src/QbXml/QbXmlResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,18 @@ public IEnumerable<object> GetItemsFromResponse(string response, System.Type typ

private IEnumerable<object> SearchFor(QBXML qbXml, System.Type type)
{
foreach (var item in qbXml.Items)
if (qbXml.Items != null)
{
if (item is QBXMLMsgsRs typedItem)
foreach (var item in qbXml.Items)
{
foreach (var innerItem in typedItem.Items)
if (item is QBXMLMsgsRs typedItem && typedItem.Items != null)
{
if (innerItem.GetType() == type || type.IsAssignableFrom(innerItem.GetType()))
foreach (var innerItem in typedItem.Items)
{
yield return innerItem;
if (innerItem.GetType() == type || type.IsAssignableFrom(innerItem.GetType()))
{
yield return innerItem;
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/XsdGenerator/MemberEnhancer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ private XmlSchemaElement GetSchemaElement(XmlSchemaComplexType xmlSchemaComplexT
.FirstOrDefault(m => m.QualifiedName?.Name == name);

// Let's try to search in the choices.
if (xmlSchemaElementFound == null)
if (xmlSchemaElementFound == null && xmlSchemaSequence.Items != null)
{
foreach (var choice in xmlSchemaSequence.Items.OfType<XmlSchemaChoice>())
{
Expand Down