diff options
author | lbsa71 | 2008-07-27 13:59:07 +0000 |
---|---|---|
committer | lbsa71 | 2008-07-27 13:59:07 +0000 |
commit | f417a034140b3c66271a3953c6b6355b54d663f4 (patch) | |
tree | 02f1cb335063128777f15cf3c779a467f85c186b /OpenSim | |
parent | * Added safeguard to ensure valid inventoryserver uri. (diff) | |
download | opensim-SC_OLD-f417a034140b3c66271a3953c6b6355b54d663f4.zip opensim-SC_OLD-f417a034140b3c66271a3953c6b6355b54d663f4.tar.gz opensim-SC_OLD-f417a034140b3c66271a3953c6b6355b54d663f4.tar.bz2 opensim-SC_OLD-f417a034140b3c66271a3953c6b6355b54d663f4.tar.xz |
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.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs b/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs index ba23d82..7f0e2d6 100644 --- a/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs +++ b/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs | |||
@@ -68,14 +68,22 @@ namespace OpenSim.Framework.AssetLoader.Filesystem | |||
68 | { | 68 | { |
69 | FileInfo fInfo = new FileInfo(path); | 69 | FileInfo fInfo = new FileInfo(path); |
70 | long numBytes = fInfo.Length; | 70 | long numBytes = fInfo.Length; |
71 | FileStream fStream = new FileStream(path, FileMode.Open, FileAccess.Read); | 71 | if (fInfo.Exists) |
72 | byte[] idata = new byte[numBytes]; | 72 | { |
73 | BinaryReader br = new BinaryReader(fStream); | 73 | |
74 | idata = br.ReadBytes((int) numBytes); | 74 | FileStream fStream = new FileStream(path, FileMode.Open, FileAccess.Read); |
75 | br.Close(); | 75 | byte[] idata = new byte[numBytes]; |
76 | fStream.Close(); | 76 | BinaryReader br = new BinaryReader(fStream); |
77 | info.Data = idata; | 77 | idata = br.ReadBytes((int)numBytes); |
78 | //info.loaded=true; | 78 | br.Close(); |
79 | fStream.Close(); | ||
80 | info.Data = idata; | ||
81 | //info.loaded=true; | ||
82 | } | ||
83 | else | ||
84 | { | ||
85 | m_log.ErrorFormat("[ASSETS]: file: [{0}] not found !", path); | ||
86 | } | ||
79 | } | 87 | } |
80 | 88 | ||
81 | public void ForEachDefaultXmlAsset(Action<AssetBase> action) | 89 | public void ForEachDefaultXmlAsset(Action<AssetBase> action) |