Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] NullReferenceException StartWorker() #469

Closed
Hofknecht opened this issue Mar 1, 2023 · 3 comments
Closed

[BUG] NullReferenceException StartWorker() #469

Hofknecht opened this issue Mar 1, 2023 · 3 comments
Projects
Milestone

Comments

@Hofknecht
Copy link
Owner

Hofknecht commented Mar 1, 2023

1x reported:
System.NullReferenceException: Object reference not set to an instance of an object. at SystemTrayMenu.Business.Menus.StartWorker() at SystemTrayMenu.Business.Menus.SwitchOpenClose(Boolean byClick, Boolean isMainPreload) at SystemTrayMenu.Business.Menus.SwitchOpenCloseByTaskbarItem() at SystemTrayMenu.App.TasbkarItemActivated(Object sender, EventArgs e) at System.Windows.Forms.Form.set_Active(Boolean value) at System.Windows.Forms.Form.WmActivate(Message

1x reported:
System.NullReferenceException: Object reference not set to an instance of an object. at SystemTrayMenu.Business.Menus.StartWorker() at SystemTrayMenu.Business.Menus.SwitchOpenClose(Boolean byClick, Boolean isMainPreload) at SystemTrayMenu.Business.Menus.SwitchOpenCloseByTaskbarItem() at SystemTrayMenu.App.TasbkarItemActivated(Object sender, EventArgs e) at System.Windows.Forms.Form.OnActivated(EventArgs e) at System.Windows.Forms.Form.set_Active(Boolean value) at System.Windows.Forms.Form.WmActivate(Message

1x reported:
System.NullReferenceException: Object reference not set to an instance of an object. at SystemTrayMenu.Business.Menus.StartWorker() at SystemTrayMenu.Business.Menus.SwitchOpenClose(Boolean byClick, Boolean isMainPreload) at SystemTrayMenu.Business.Menus.SwitchOpenCloseByTaskbarItem() at SystemTrayMenu.App.TasbkarItemActivated(Object sender, EventArgs e) at System.Windows.Forms.Form.OnActivated(EventArgs e) at System.Windows.Forms.Form.set_Active(Boolean value) at System.Windows.Forms.Form.WmActivate(Message

1x reported:
System.NullReferenceException: Object reference not set to an instance of an object. at SystemTrayMenu.Business.Menus.StartWorker() at SystemTrayMenu.Business.Menus.SwitchOpenClose(Boolean byClick, Boolean isMainPreload) at SystemTrayMenu.Business.Menus.SwitchOpenCloseByTaskbarItem() at SystemTrayMenu.App.TasbkarItemActivated(Object sender, EventArgs e) at System.Windows.Forms.Form.OnActivated(EventArgs e) at System.Windows.Forms.Form.set_Active(Boolean value) at System.Windows.Forms.Form.WmActivate(Message

1x reported:
System.NullReferenceException: Object reference not set to an instance of an object. at SystemTrayMenu.Business.Menus.StartWorker() at SystemTrayMenu.Business.Menus.SwitchOpenClose(Boolean byClick, Boolean isMainPreload) at SystemTrayMenu.Business.Menus.SwitchOpenCloseByTaskbarItem() at SystemTrayMenu.App.TasbkarItemActivated(Object sender, EventArgs e) at System.Windows.Forms.Form.OnActivated(EventArgs e) at System.Windows.Forms.Form.set_Active(Boolean value) at System.Windows.Forms.Form.WmActivate(Message

1x reported:
System.NullReferenceException: Object reference not set to an instance of an object. at SystemTrayMenu.Business.Menus.StartWorker() at SystemTrayMenu.Business.Menus.SwitchOpenClose(Boolean byClick, Boolean isMainPreload) at SystemTrayMenu.Business.Menus.SwitchOpenCloseByTaskbarItem() at SystemTrayMenu.App.TasbkarItemActivated(Object sender, EventArgs e) at System.Windows.Forms.Form.OnActivated(EventArgs e) at System.Windows.Forms.Form.set_Active(Boolean value) at System.Windows.Forms.Form.WmActivate(Message

@Hofknecht Hofknecht added this to the 1.4 milestone Mar 1, 2023
@Hofknecht Hofknecht added this to Analyze / Spec in STM 1.4.0 via automation Mar 1, 2023
@Hofknecht
Copy link
Owner Author

Hofknecht commented Mar 1, 2023

internal void StartWorker()
        {
            if (Properties.Settings.Default.GenerateShortcutsToDrives)
            {
                GenerateDriveShortcuts.Start();
            }

            if (!workerMainMenu.IsBusy)
            {
                LoadStarted();
                workerMainMenu.RunWorkerAsync(
                    new object[] { Config.Path, 0 });
            }
        }

@Hofknecht
Copy link
Owner Author

for me looks like only workerMainMenu can be null ?! but why
=>analyze

@topeterk
Copy link
Collaborator

topeterk commented Mar 1, 2023

On STM v2 I modified the function due to potential null value warning on the LoadStarted method:

internal void StartWorker()
{
    if (Settings.Default.GenerateShortcutsToDrives)
    {
        GenerateDriveShortcuts.Start();
    }

    if (!workerMainMenu.IsBusy)
    {
        LoadStarted?.Invoke();
        workerMainMenu.RunWorkerAsync(
            new object[] { Config.Path, 0 });
    }
}

STM 1.4.0 automation moved this from Analyze / Spec to Closed Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
STM 1.4.0
  
Closed
Development

No branches or pull requests

2 participants