Skip to content

Commit

Permalink
poi: bug 60288: remove defensive copy for internal relationships. Pat…
Browse files Browse the repository at this point in the history
…ch from Tim Helmstedt.
  • Loading branch information
antony-liu committed Mar 13, 2024
1 parent 520b079 commit cc1de9a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion openxml4Net/OPC/OPCPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1548,7 +1548,7 @@ public bool HasRelationships
*/
public bool IsRelationshipExists(PackageRelationship rel)
{
foreach (PackageRelationship r in this.Relationships)
foreach (PackageRelationship r in relationships)
{
if (r == rel)
return true;
Expand Down
13 changes: 3 additions & 10 deletions openxml4Net/OPC/PackagePart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -473,17 +473,10 @@ public bool HasRelationships
*/
public bool IsRelationshipExists(PackageRelationship rel)
{
try
foreach (PackageRelationship r in _relationships)
{
foreach (PackageRelationship r in this.Relationships)
{
if (r == rel)
return true;
}
}
catch (InvalidFormatException)
{

if (r == rel)
return true;
}
return false;
}
Expand Down

0 comments on commit cc1de9a

Please sign in to comment.