Opened 8 years ago

Closed 8 years ago

#358 closed defect (fixed)

Handle factory.CreateObjectsFromFile where GetFileAsSupportedType returns null

Reported by: ibboard Owned by:
Priority: major Milestone: WarFoundry API 0.2
Component: WarFoundry-API Version: Trunk
Keywords: Cc:
Blocked By: Blocking:

Description

factory.CreateObjectsFromFile is a public method from the interface. If called directly with a file that causes GetFileAsSupportedType to return null (e.g. zip error or wrong file format) then it should stop handling the file and return an empty collection. Instead, it errors in the finally block because the file it tries to close is null.

Change History (3)

comment:1 Changed 8 years ago by IBBoard <dev@…>

In [2a36ebb7b6a9e1aeb40132a2c2e71bbc23634c48/IBBoard.WarFoundry.API]:

Re #358: Handle factory.CreateObjectsFromFile where GetFileAsSupportedType returns null

  • Refactor out methods for file loading
  • Add "if zip file not null" check around newly refactored method

comment:2 Changed 8 years ago by IBBoard <dev@…>

In [6b9e86d4be953cf5ece832437c4df7e15047e1a1/IBBoard.WarFoundry.API.Tests]:

Re #358: Handle factory.CreateObjectsFromFile where GetFileAsSupportedType returns null

  • Add specific unit test

comment:3 Changed 8 years ago by ibboard

Resolution: fixed
Status: newclosed

Fixed by code check and unit test

Note: See TracTickets for help on using tickets.