Skip to content

Starting a new game with the Uninstall Mod flag set to true causes a crash #131

@Evolter

Description

@Evolter
ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NullPointerException: Cannot invoke "com.fs.starfarer.ui.newui.L.setCurrentTab(Object, Object)" because "this.core" is null
java.lang.NullPointerException: Cannot invoke "com.fs.starfarer.ui.newui.L.setCurrentTab(Object, Object)" because "this.core" is null
	at com.fs.starfarer.campaign.CampaignState.showCoreUITab(Unknown Source)
	at stelnet.StelnetMod.resetIntelUi(StelnetMod.java:60)
	at stelnet.StelnetMod.beforeGameSave(StelnetMod.java:32)

The following check is not enough:

        CampaignUIAPI campaignUi = Global.getSector().getCampaignUI();
        if (campaignUi == null) {
            return;
        }
        campaignUi.showCoreUITab(CoreUITabId.INTEL, null);

We either need to find a way to check "core" is not null or modify onGameLoad since it will be called before the first save with newGame=true.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions