diff --git a/gama.core/src/gama/core/util/file/GamaGridFile.java b/gama.core/src/gama/core/util/file/GamaGridFile.java index 3b00b7f07d..8d08f98aa0 100644 --- a/gama.core/src/gama/core/util/file/GamaGridFile.java +++ b/gama.core/src/gama/core/util/file/GamaGridFile.java @@ -634,7 +634,7 @@ void read(final IScope scope, final boolean readAll, final boolean createGeometr records.fill(i, bands); rect.setAttribute("grid_value", bands.get(0)); rect.setAttribute("bands", bands); - ((IList) getBuffer()).add(rect); + getBuffer().add(rect); } } } @@ -822,7 +822,7 @@ protected SimpleFeatureCollection getFeatureCollection(final IScope scope) { @Override public double getNoData(final IScope scope) { - return noData.doubleValue(); + return noData == null ? IField.NO_NO_DATA : noData.doubleValue(); } @Override diff --git a/gaml.compiler/src/gaml/compiler/gaml/indexer/GamlResourceIndexer.java b/gaml.compiler/src/gaml/compiler/gaml/indexer/GamlResourceIndexer.java index 7905dee2d1..8e2c5cf2a0 100644 --- a/gaml.compiler/src/gaml/compiler/gaml/indexer/GamlResourceIndexer.java +++ b/gaml.compiler/src/gaml/compiler/gaml/indexer/GamlResourceIndexer.java @@ -30,13 +30,13 @@ import gama.core.util.GamaMapFactory; import gama.core.util.IMap; import gama.dev.DEBUG; -import gaml.compiler.gaml.resource.GamlResource; -import gaml.compiler.gaml.resource.ImportedResources; import gaml.compiler.gaml.ExperimentFileStructure; import gaml.compiler.gaml.GamlPackage; import gaml.compiler.gaml.Import; import gaml.compiler.gaml.Model; import gaml.compiler.gaml.impl.ModelImpl; +import gaml.compiler.gaml.resource.GamlResource; +import gaml.compiler.gaml.resource.ImportedResources; /** * The Class GamlResourceIndexer. @@ -113,7 +113,8 @@ private static Map getImportsAsAbsoluteURIS(final URI baseURI, fina static private EObject findImport(final EObject contents, final URI baseURI, final URI uri) { if (contents instanceof ExperimentFileStructure expe) { String u = expe.getExp().getImportURI(); - if (u.contains(URI.decode(uri.lastSegment())) || uri.equals(baseURI) && u.isEmpty()) return contents; + String lastSegment = URI.decode(uri.lastSegment()); + if (lastSegment != null && u.contains(lastSegment) || uri.equals(baseURI) && u.isEmpty()) return contents; } else if (contents instanceof Model model) { for (final Import imp : model.getImports()) { if (imp.getImportURI().contains(URI.decode(uri.lastSegment()))) return imp;