diff --git a/platform/script-debugger/backend/src/org/jetbrains/debugger/sourcemap/SourceMapDecoder.java b/platform/script-debugger/backend/src/org/jetbrains/debugger/sourcemap/SourceMapDecoder.java index a0f475741b46..431a1156ae89 100644 --- a/platform/script-debugger/backend/src/org/jetbrains/debugger/sourcemap/SourceMapDecoder.java +++ b/platform/script-debugger/backend/src/org/jetbrains/debugger/sourcemap/SourceMapDecoder.java @@ -67,10 +67,10 @@ public final class SourceMapDecoder { @Nullable private static SourceMap parseMap(JsonReaderEx reader, - int line, - int column, - List mappings, - @NotNull Function, SourceResolver> sourceResolverFactory) throws IOException { + int line, + int column, + List mappings, + @NotNull Function, 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 sources = readSources(sourcesReader, sourceRoot); @SuppressWarnings("unchecked")