rheirman / WhatTheHack

Mechanoid hacking
16 stars 18 forks source link

NRE in Dialog_FormCaravan_DoBottomButtons.AddWarnings #46

Open NoirFry opened 4 years ago

NoirFry commented 4 years ago

Not 100% sure why, but warnings is null here in my game.

public static void AddWarnings(Dialog_FormCaravan instance, ref List<string> warnings)

and will throw NRE later:

if(numPlatforms < numMechanoids)
{
    warnings.Add("WTH_Warning_NotEnoughPlatforms".Translate());

For now as a workaround, i just added null check and return. Seems like it's working fine.

if (warnings == null)
    return;