Source:
<code>private Map<String, String> fetchRemoteScripts(String location, boolean isRecursive) { final Map<String, String> scripts = new HashMap<>(); final String contentTreeUrl = getContentTreeUrl(location); final JsonParser jsonParser = new JsonParser(); try (Reader reader = new InputStreamReader(new URL(contentTreeUrl).openStream())) { <START> final JsonObject rootObject = jsonParser.parse(reader).getAsJsonObject(); <END> final JsonArray projectTree = rootObject.getAsJsonArray(JSON_TREE_LABEL); for (final JsonElement element : projectTree) { final JsonObject object = element.getAsJsonObject(); final String scriptPath = object.get(JSON_PATH_LABEL).getAsString(); final String scriptName = (scriptPath.contains(SEPARATOR)) ? getScriptName(scriptPath) : scriptPath; final String scriptSHA = object.get(JSON_SHA_LABEL).getAsString(); final String scriptType = object.get(JSON_TYPE_LABEL).getAsString(); if (scriptType.equals(JSON_BLOB_LABEL)) { final String repositoryName = getRepositoryName(location); final String relativeScriptPath = getRelativeScriptPath(location); if (isRecursive) { if (repositoryName.equals(relativeScriptPath) || scriptPath.startsWith(relativeScriptPath)) { scripts.put(scriptSHA, scriptPath); } } else if ((repositoryName.equals(relativeScriptPath) && !scriptPath.contains(SEPARATOR)) || (scriptPath.endsWith(relativeScriptPath + SEPARATOR + scriptName))) { scripts.put(scriptSHA, scriptPath); } } } } catch (final IOException e) { Logger.error(Activator.PLUGIN_ID, "Unable to fetch content: " + e.getMessage()); } return scripts; }</code><technical_language>null checks missing everywhere</technical_language>

Target:
private Map<String, String> fetchRemoteScripts(String location, boolean isRecursive) { final Map<String, String> scripts = new HashMap<>(); final String contentTreeUrl = getContentTreeUrl(location); final JsonParser jsonParser = new JsonParser(); try (Reader reader = new InputStreamReader(new URL(contentTreeUrl).openStream())) { final JsonObject rootObject = jsonParser.parse(reader).getAsJsonObject(); if (rootObject == null) return scripts; final JsonArray projectTree = rootObject.getAsJsonArray(JSON_TREE_LABEL); if (projectTree == null) return scripts; for (final JsonElement element : projectTree) { final JsonObject object = element.getAsJsonObject(); if (object == null) continue; final String scriptPath = object.get(JSON_PATH_LABEL).getAsString(); final String scriptName = (scriptPath.contains(SEPARATOR)) ? getScriptName(scriptPath) : scriptPath; final String scriptSHA = object.get(JSON_SHA_LABEL).getAsString(); final String scriptType = object.get(JSON_TYPE_LABEL).getAsString(); if ((scriptType == null) && (scriptName == null) && (scriptSHA == null) && (scriptType == null)) continue; if (JSON_BLOB_LABEL.equals(scriptType)) { final String repositoryName = getRepositoryName(location); final String relativeScriptPath = getRelativeScriptPath(location); if (repositoryName != null) { if (isRecursive) { if ((((repositoryName.equals(relativeScriptPath))) || scriptPath.startsWith(relativeScriptPath))) { scripts.put(scriptSHA, scriptPath); } } else if ((repositoryName.equals(relativeScriptPath) && !scriptPath.contains(SEPARATOR)) || (scriptPath.endsWith(relativeScriptPath + SEPARATOR + scriptName))) { scripts.put(scriptSHA, scriptPath); } } } } } catch (final IOException e) { Logger.error(Activator.PLUGIN_ID, "Unable to fetch content: " + e.getMessage()); } return scripts; }