Go back to having BundleUtil return null rather than throwing FNF.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2132 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: BundleUtil.java,v 1.4 2003/01/13 22:53:04 mdb Exp $
|
||||
// $Id: BundleUtil.java,v 1.5 2003/01/14 00:36:14 mdb Exp $
|
||||
|
||||
package com.threerings.cast.bundle;
|
||||
|
||||
@@ -45,8 +45,6 @@ public class BundleUtil
|
||||
*
|
||||
* @return the unserialized object in question.
|
||||
*
|
||||
* @exception FileNotFoundException thrown if no object exists with
|
||||
* the specified path.
|
||||
* @exception IOException thrown if an I/O error occurs while reading
|
||||
* the object from the bundle.
|
||||
*/
|
||||
@@ -56,7 +54,7 @@ public class BundleUtil
|
||||
try {
|
||||
InputStream bin = bundle.getResource(path);
|
||||
if (bin == null) {
|
||||
throw new FileNotFoundException(path);
|
||||
return null;
|
||||
}
|
||||
return new ObjectInputStream(bin).readObject();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: BundledComponentRepository.java,v 1.23 2003/01/13 22:53:04 mdb Exp $
|
||||
// $Id: BundledComponentRepository.java,v 1.24 2003/01/14 00:36:14 mdb Exp $
|
||||
|
||||
package com.threerings.cast.bundle;
|
||||
|
||||
@@ -110,10 +110,9 @@ public class BundledComponentRepository
|
||||
// now go back and load up all of the component information
|
||||
for (int i = 0; i < rbundles.length; i++) {
|
||||
HashIntMap comps = null;
|
||||
try {
|
||||
comps = (HashIntMap)BundleUtil.loadObject(
|
||||
rbundles[i], BundleUtil.COMPONENTS_PATH);
|
||||
} catch (FileNotFoundException fnfe) {
|
||||
comps = (HashIntMap)BundleUtil.loadObject(
|
||||
rbundles[i], BundleUtil.COMPONENTS_PATH);
|
||||
if (comps == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -294,10 +293,8 @@ public class BundledComponentRepository
|
||||
String path = root + action + BundleUtil.TILESET_EXTENSION;
|
||||
|
||||
try {
|
||||
TileSet aset = null;
|
||||
try {
|
||||
aset = (TileSet)BundleUtil.loadObject(_bundle, path);
|
||||
} catch (FileNotFoundException fnfe) {
|
||||
TileSet aset = (TileSet)BundleUtil.loadObject(_bundle, path);
|
||||
if (aset == null) {
|
||||
Log.debug("Falling back to default [path=" + path + "].");
|
||||
// try loading the default tileset
|
||||
path = root + ActionSequence.DEFAULT_SEQUENCE +
|
||||
|
||||
Reference in New Issue
Block a user