Example from CMO build 1147.30 release posting.
Build 1147.29 or 30 (probably anything before as well) along with DB3K 489.
SNB-1 Kansan -- Tonga (Air Force), 1996-2006, 1x does not appear to be viewable in the DB viewer.
This is caused by Database issue in db3k v489.
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.
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?
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 >