mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
aware of not sourcemap file
This commit is contained in:
+10
-9
@@ -67,10 +67,10 @@ public final class SourceMapDecoder {
|
||||
|
||||
@Nullable
|
||||
private static SourceMap parseMap(JsonReaderEx reader,
|
||||
int line,
|
||||
int column,
|
||||
List<MappingEntry> mappings,
|
||||
@NotNull Function<List<String>, SourceResolver> sourceResolverFactory) throws IOException {
|
||||
int line,
|
||||
int column,
|
||||
List<MappingEntry> mappings,
|
||||
@NotNull Function<List<String>, SourceResolver> sourceResolverFactory) throws IOException {
|
||||
reader.beginObject();
|
||||
String sourceRoot = null;
|
||||
JsonReaderEx sourcesReader = null;
|
||||
@@ -120,6 +120,12 @@ public final class SourceMapDecoder {
|
||||
}
|
||||
reader.close();
|
||||
|
||||
// check it before other checks, probably it is not sourcemap file
|
||||
if (StringUtil.isEmpty(encodedMappings)) {
|
||||
// empty map
|
||||
return null;
|
||||
}
|
||||
|
||||
if (version != 3) {
|
||||
throw new IOException("Unsupported sourcemap version: " + version);
|
||||
}
|
||||
@@ -128,11 +134,6 @@ public final class SourceMapDecoder {
|
||||
throw new IOException("sources is not specified");
|
||||
}
|
||||
|
||||
if (StringUtil.isEmpty(encodedMappings)) {
|
||||
// empty map
|
||||
return null;
|
||||
}
|
||||
|
||||
List<String> sources = readSources(sourcesReader, sourceRoot);
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
Reference in New Issue
Block a user