mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -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;
|
||||
}
|
||||
if (isNewLine) {
|
||||
if (pendingFileName != null || pendingLineNumber >= 0) {
|
||||
if (pendingFileName != null && pendingLineNumber >= 0) {
|
||||
printLineDirective(pendingFileName, pendingLineNumber);
|
||||
pendingLineNumber = -1;
|
||||
pendingFileName = null;
|
||||
|
|
|
@ -55,6 +55,7 @@ public final class ExceptionHandling {
|
|||
while (location != null) {
|
||||
MethodLocation methodLocation = location.method;
|
||||
|
||||
if (methodLocation != null) {
|
||||
Console.printString(" at ");
|
||||
if (methodLocation.className == null || methodLocation.methodName == null) {
|
||||
Console.printString("(Unknown method)");
|
||||
|
@ -70,6 +71,7 @@ public final class ExceptionHandling {
|
|||
Console.printInt(location.lineNumber);
|
||||
}
|
||||
Console.printString(")\n");
|
||||
}
|
||||
|
||||
location = location.next;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user