Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#226 closed defect (released)

"NullReferenceException" for a unitID

Reported by: Henri Owned by:
Priority: major Milestone: WarFoundry 0.1
Component: WarFoundry-API Version: Unknown or N/A
Keywords: Cc:
Blocked By: Blocking:

Description

Got an unhandled exception when I mistyped a unitID in a containedunitID statement. In my example the id referred to was "ZagstruK" and the actual name of the id "Zagstruk". I.e. the last capital letter differs.

The user should be "protected" from "bad" datafiles so this should have a handler/message box. It would also assist when debugging datafiles.

Attachments (1)

crash1.txt (5.7 KB) - added by Henri 10 years ago.

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by Henri

Attachment: crash1.txt added

comment:1 Changed 10 years ago by ibboard

Status: newconfirmed

Confirmed that it is bad behaviour, although we should probably fail to load and log it the same as any other error (suggestions for better ways to show failures than the log can go in a feature request ticket or the forums :) ). I thought we handled it better than that, but obviously not.

comment:2 Changed 10 years ago by ibboard

Resolution: fixed
Status: confirmedclosed

(In r419) Fixes #226: "NullReferenceException" for a unitID

  • Add null check and throw InvalidFileException when getting unit XML by ID
  • Change InvalidDataException (which is a core exception about data streams) to InvalidFileException (which is our exception for incorrect data in a file)

comment:3 Changed 10 years ago by ibboard

(In r420) Re #226

  • Fix missing "using" import caused by r419

no-open-ticket

comment:4 Changed 10 years ago by ibboard

released: noyes

Release as part of v0.1b6

comment:5 Changed 10 years ago by ibboard

Resolution: fixedreleased

Mark fix as released under a previous version

Note: See TracTickets for help on using tickets.