Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Null in DB causes DBViewer to not display entry

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Tech Support >> Null in DB causes DBViewer to not display entry Page: [1]
Login
Message << Older Topic   Newer Topic >>
Null in DB causes DBViewer to not display entry - 8/7/2021 3:49:53 AM   
KnightHawk75

 

Posts: 1360
Joined: 11/15/2018
Status: online
Example from CMO build 1147.30 release posting.

Build 1147.29 or 30 (probably anything before as well) along with DB3K 489.
quote:

ORIGINAL: tylerblakebrandon

SNB-1 Kansan -- Tonga (Air Force), 1996-2006, 1x does not appear to be viewable in the DB viewer.

Can Confirm.
This is caused by Database issue in db3k v489.

What's happening:
During the data conversion for display, an exception is caused, and trapped by the NativeWindow Callback, The error is: InvalidCast Exception. Conversion from DBNull to type Single is not valid.
Because of where the error is trapped and handled it does not get logged to the standard exception log.

Root cause:
The following Loadout ID's for the SNB-1 Kansan have NULL entries for PayloadWeightDragModifer. The code is expecting a non-null value.
#28420 (0.5 ton cargo[no drop])
#28421 (passenger, 1xVIP)
They are the only entries in v489 that are missing values for that field.
DBFix: DB490+ should modify these entries to contain data, looks like should be 0.0 for both, or maybe 0.0266 and 0.0, or whatever is actually right when it comes to #28420.
Also the piece of code could be changed to check for DBNull first and handle that case before conversion.
Additionally but unrelated to the problem, I think both weapon-record entries here for these in DataLoadoutWeapons table should be marking the entries Internal=1 since they both are internal cargo and don't involve drop ability, no?

edit:
If it helps save developer time, search for "Error at 200473", in DBFunctions, it'll be some function with the spec 'public static void \SOMETHING (ref Aircraft Arg1, int dbidprobablyAsArg2, bool mandatoryOnlyprobablyAsArg3)'. Inside (above what the try block message relates too) there is a line like 'Loadout loadout new Loadout(..long list of params ... including an inline conversions.ToSingle(datarow["PayloadWeightDragModifier"])) that's the conversion that throws.



< Message edited by KnightHawk75 -- 8/7/2021 7:08:08 AM >
Post #: 1
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Tech Support >> Null in DB causes DBViewer to not display entry Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.160