NullReferenceException after changing the code

I am getting a NullReferenceException every time I change something in my code while the game is running. The exception looks like this:

NullReferenceException: Object reference not set to an instance of an object
MainMenu.Update () (at Assets/Scripts/Menu Handlers/MainMenu.cs:26)

And here is line 26:

void Update() {
	settings.tick(); // Line 26
}

The settings variable happens to be null even though I set it like that:

public static Settings settings;
	
	void Start() {
		settings = new Settings(mobile);
	}

The Settings script does not extend anything

It can be done for the correct answer see here

a quick untested guess would be change your code to

public static Settings settings;
 
    void OnEnable() {
       settings = new Settings(mobile);
    }