Beluki / GaGa

A minimal radio player for the Windows Tray.
35 stars 13 forks source link

Exception message when system does not have MediaPlayer will not proc #8

Closed arigoru closed 5 years ago

arigoru commented 5 years ago

In short, exception message at GaGa/NotifyIconPlayer/Player.cs, line 365, will not be shown to user if there is no MediaPlayer in the system, so user wont be able to understand what happens and get incoherent "memory can't be read" message.
Reason for that is usage of "Source" in lines 362 and 363, which will be "null" on first launch and exception would be called before anything is assigned to it.
This is function in question:

 private void OnMediaFailed(Object sender, ExceptionEventArgs e)
        {
            Stop();

            String title = "Unable to play: " + Source.Name;
            String text = e.ErrorException.Message + "\n" + Source.Uri;

            notifyIcon.ShowBalloonTip(10, title, text, ToolTipIcon.Error);
}

Assigning "title" and "text" will both trow errors before function ends, because on first launch without MediaPlayer present in system "Source" will be "null".

appel commented 5 years ago

Hey @Esuil,

Unfortunately Beluki, the original author of GaGa, died back in 2016: https://github.com/Beluki/GaGa/pull/7#issuecomment-358929866

It seems there is currently no one in charge, so your best bet would be to fork this repo and patch it yourself.

arigoru commented 5 years ago

@appel That is unfortunate, thank you for letting me know. I will take a look on if I will want to fork and patch it later.