diff --git a/EnvelopeGenerator.Form/My Project/AssemblyInfo.vb b/EnvelopeGenerator.Form/My Project/AssemblyInfo.vb index 9fa1908c..3fb0b26e 100644 --- a/EnvelopeGenerator.Form/My Project/AssemblyInfo.vb +++ b/EnvelopeGenerator.Form/My Project/AssemblyInfo.vb @@ -11,7 +11,7 @@ Imports System.Runtime.InteropServices - + ' Setting ComVisible to false makes the types in this assembly not visible @@ -32,5 +32,5 @@ Imports System.Runtime.InteropServices ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' [assembly: AssemblyVersion("1.0.*")] - + diff --git a/EnvelopeGenerator.Form/frmSplashScreen.vb b/EnvelopeGenerator.Form/frmSplashScreen.vb index bfaeb7da..4bdd816b 100644 --- a/EnvelopeGenerator.Form/frmSplashScreen.vb +++ b/EnvelopeGenerator.Form/frmSplashScreen.vb @@ -90,7 +90,9 @@ Public Class frmSplashScreen Thread.Sleep(300) ' This checks for module access and admin rights - oUserModel.CheckUserLogin(oUser) + If oUser IsNot Nothing Then + oUserModel.CheckUserLogin(oUser) + End If Worker.ReportProgress(100, "Starting Application") Thread.Sleep(300) @@ -113,6 +115,10 @@ Public Class frmSplashScreen Dim oState As State = DirectCast(e.Result, State) + If oState.User Is Nothing Or oState.UserId = 0 Then + Throw New ApplicationException($"User {Environment.UserName} is unknown. Please contact your administrator. Application will close!") + End If + Dim oCultureInfo As CultureInfo oCultureInfo = New CultureInfo(oState.User.Language) Thread.CurrentThread.CurrentCulture = oCultureInfo @@ -143,7 +149,4 @@ Public Class frmSplashScreen End Try End Sub - - - End Class \ No newline at end of file