Skip to content

[Bug] NullPointerException if the config class of mod updated #110

@Jaffe2718

Description

@Jaffe2718

If I update the config class of the mod which is depends on midnightlib, then it will cause java.lang.NullPointerException.

For example, the old config class:

public class MyConfig extends MidnightConfig {

    public enum OldConfig {
        ONE, TWO, THREE
    }

    @Entry
    public static OldConfig oldConfig = OldConfig.ONE;
}

Then I update the class in a new version of mod:

public class MyConfig extends MidnightConfig {

    public enum NewConfig {
        A, B, C
    }

    @Entry
    public static NewConfig newConfig = NewConfig.A;
}

As a result, the mod cannot read the old json file correctly so that it will cause java.lang.NullPointerException.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions