mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2025-01-08 07:54:11 -08:00
Fix potential NPEs in compiler and native runtime
This commit is contained in:
parent
560627bfca
commit
631111bdb3
|
@ -131,7 +131,7 @@ public class BufferedCodeWriter extends CodeWriter {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (isNewLine) {
|
if (isNewLine) {
|
||||||
if (pendingFileName != null || pendingLineNumber >= 0) {
|
if (pendingFileName != null && pendingLineNumber >= 0) {
|
||||||
printLineDirective(pendingFileName, pendingLineNumber);
|
printLineDirective(pendingFileName, pendingLineNumber);
|
||||||
pendingLineNumber = -1;
|
pendingLineNumber = -1;
|
||||||
pendingFileName = null;
|
pendingFileName = null;
|
||||||
|
|
|
@ -55,21 +55,23 @@ public final class ExceptionHandling {
|
||||||
while (location != null) {
|
while (location != null) {
|
||||||
MethodLocation methodLocation = location.method;
|
MethodLocation methodLocation = location.method;
|
||||||
|
|
||||||
Console.printString(" at ");
|
if (methodLocation != null) {
|
||||||
if (methodLocation.className == null || methodLocation.methodName == null) {
|
Console.printString(" at ");
|
||||||
Console.printString("(Unknown method)");
|
if (methodLocation.className == null || methodLocation.methodName == null) {
|
||||||
} else {
|
Console.printString("(Unknown method)");
|
||||||
Console.printString(methodLocation.className.value);
|
} else {
|
||||||
Console.printString(".");
|
Console.printString(methodLocation.className.value);
|
||||||
Console.printString(methodLocation.methodName.value);
|
Console.printString(".");
|
||||||
|
Console.printString(methodLocation.methodName.value);
|
||||||
|
}
|
||||||
|
Console.printString("(");
|
||||||
|
if (methodLocation.fileName != null && location.lineNumber >= 0) {
|
||||||
|
Console.printString(methodLocation.fileName.value);
|
||||||
|
Console.printString(":");
|
||||||
|
Console.printInt(location.lineNumber);
|
||||||
|
}
|
||||||
|
Console.printString(")\n");
|
||||||
}
|
}
|
||||||
Console.printString("(");
|
|
||||||
if (methodLocation.fileName != null && location.lineNumber >= 0) {
|
|
||||||
Console.printString(methodLocation.fileName.value);
|
|
||||||
Console.printString(":");
|
|
||||||
Console.printInt(location.lineNumber);
|
|
||||||
}
|
|
||||||
Console.printString(")\n");
|
|
||||||
|
|
||||||
location = location.next;
|
location = location.next;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user