Guard against Assembly.GetEntryAssembly() being null
This commit is contained in:
@@ -458,8 +458,15 @@ namespace OpenMetaverse
|
||||
public static System.IO.Stream GetResourceStream(string resourceName, string searchPath)
|
||||
{
|
||||
if (searchPath != null)
|
||||
{
|
||||
string filename = System.IO.Path.Combine(System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), searchPath), resourceName);
|
||||
{
|
||||
Assembly gea = Assembly.GetEntryAssembly();
|
||||
string dirname = ".";
|
||||
if (gea != null)
|
||||
{
|
||||
dirname = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(gea.Location), searchPath);
|
||||
}
|
||||
|
||||
string filename = System.IO.Path.Combine(dirname, resourceName);
|
||||
try
|
||||
{
|
||||
return new System.IO.FileStream(
|
||||
|
||||
Reference in New Issue
Block a user