Skip to content

Commit f3907e2

Browse files
committed
Handle Assembly being null
1 parent a2ed6aa commit f3907e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Microsoft.Toolkit.Uwp.Notifications/Toasts/Compat/Desktop/Win32AppInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ private static string HashAppId(string appId)
126126
private static string GetDisplayNameFromCurrentProcess(Process process)
127127
{
128128
// If AssemblyTitle is set, use that
129-
var assemblyTitleAttr = Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyTitleAttribute>();
129+
var assemblyTitleAttr = Assembly.GetEntryAssembly()?.GetCustomAttribute<AssemblyTitleAttribute>();
130130
if (assemblyTitleAttr != null)
131131
{
132132
return assemblyTitleAttr.Title;

0 commit comments

Comments
 (0)