mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
Mantis#1817. Thank you kindly, sacha magne, for a patch that:
* Fixes a simulator crash when an asset file is missing on loading asset library.
This commit is contained in:
@@ -68,14 +68,22 @@ namespace OpenSim.Framework.AssetLoader.Filesystem
|
||||
{
|
||||
FileInfo fInfo = new FileInfo(path);
|
||||
long numBytes = fInfo.Length;
|
||||
FileStream fStream = new FileStream(path, FileMode.Open, FileAccess.Read);
|
||||
byte[] idata = new byte[numBytes];
|
||||
BinaryReader br = new BinaryReader(fStream);
|
||||
idata = br.ReadBytes((int) numBytes);
|
||||
br.Close();
|
||||
fStream.Close();
|
||||
info.Data = idata;
|
||||
//info.loaded=true;
|
||||
if (fInfo.Exists)
|
||||
{
|
||||
|
||||
FileStream fStream = new FileStream(path, FileMode.Open, FileAccess.Read);
|
||||
byte[] idata = new byte[numBytes];
|
||||
BinaryReader br = new BinaryReader(fStream);
|
||||
idata = br.ReadBytes((int)numBytes);
|
||||
br.Close();
|
||||
fStream.Close();
|
||||
info.Data = idata;
|
||||
//info.loaded=true;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.ErrorFormat("[ASSETS]: file: [{0}] not found !", path);
|
||||
}
|
||||
}
|
||||
|
||||
public void ForEachDefaultXmlAsset(Action<AssetBase> action)
|
||||
|
||||
Reference in New Issue
Block a user