If we fail to get the deminified stackframe method, we shouldn't attempt to get the source position or file path
This commit is contained in:
Родитель
0bd150bfe8
Коммит
5d7af30c6a
|
@ -33,27 +33,30 @@ namespace SourcemapToolkit.CallstackDeminifier
|
||||||
SourcePosition generatedSourcePosition = stackFrame.SourcePosition;
|
SourcePosition generatedSourcePosition = stackFrame.SourcePosition;
|
||||||
|
|
||||||
StackFrameDeminificationResult result = base.DeminifyStackFrame(stackFrame);
|
StackFrameDeminificationResult result = base.DeminifyStackFrame(stackFrame);
|
||||||
|
if (result.DeminificationError == DeminificationError.None)
|
||||||
MappingEntry generatedSourcePositionMappingEntry = sourceMap?.GetMappingEntryForGeneratedSourcePosition(generatedSourcePosition);
|
|
||||||
|
|
||||||
if (generatedSourcePositionMappingEntry == null)
|
|
||||||
{
|
{
|
||||||
if (sourceMap == null)
|
MappingEntry generatedSourcePositionMappingEntry =
|
||||||
{
|
sourceMap?.GetMappingEntryForGeneratedSourcePosition(generatedSourcePosition);
|
||||||
result.DeminificationError = DeminificationError.NoSourceMap;
|
|
||||||
}
|
|
||||||
else if (sourceMap.ParsedMappings == null)
|
|
||||||
{
|
|
||||||
result.DeminificationError = DeminificationError.SourceMapFailedToParse;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result.DeminificationError = DeminificationError.NoMatchingMapingInSourceMap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
result.DeminifiedStackFrame.FilePath = generatedSourcePositionMappingEntry?.OriginalFileName;
|
if (generatedSourcePositionMappingEntry == null)
|
||||||
result.DeminifiedStackFrame.SourcePosition = generatedSourcePositionMappingEntry?.OriginalSourcePosition;
|
{
|
||||||
|
if (sourceMap == null)
|
||||||
|
{
|
||||||
|
result.DeminificationError = DeminificationError.NoSourceMap;
|
||||||
|
}
|
||||||
|
else if (sourceMap.ParsedMappings == null)
|
||||||
|
{
|
||||||
|
result.DeminificationError = DeminificationError.SourceMapFailedToParse;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
result.DeminificationError = DeminificationError.NoMatchingMapingInSourceMap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
result.DeminifiedStackFrame.FilePath = generatedSourcePositionMappingEntry?.OriginalFileName;
|
||||||
|
result.DeminifiedStackFrame.SourcePosition = generatedSourcePositionMappingEntry?.OriginalSourcePosition;
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче