- make "Add Asset" action of AssetPack browser more robust

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8383 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 14 years ago
parent 7e9f4b51b6
commit 82de99ca94
  1. 7
      sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/actions/AddAssetAction.java

@ -8,6 +8,7 @@ import com.jme3.gde.assetpack.AssetConfiguration;
import com.jme3.gde.assetpack.AssetPackLoader;
import com.jme3.gde.core.assets.ProjectAssetManager;
import com.jme3.gde.core.scene.SceneApplication;
import com.jme3.gde.core.scene.SceneRequest;
import com.jme3.scene.Spatial;
import java.awt.event.ActionEvent;
import java.beans.PropertyChangeListener;
@ -30,7 +31,11 @@ public final class AddAssetAction implements Action {
public void actionPerformed(ActionEvent ev) {
ProjectAssetManager pm = context.getLookup().lookup(ProjectAssetManager.class);
ProjectAssetManager scenePm = SceneApplication.getApplication().getCurrentSceneRequest().getManager();
SceneRequest req = SceneApplication.getApplication().getCurrentSceneRequest();
ProjectAssetManager scenePm = null;
if (req != null) {
scenePm = req.getManager();
}
if (pm == null) {
Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "AssetManager not found!");
return;

Loading…
Cancel
Save