我有以下控制器:
public static Result overview() {
class Earning {
public int ammount;
public String description;
}
Earning[] earnings = new Earning[5];
earnings[0].ammount = 5;
return ok(overview.render(earnings));
}
我没有在数组中创建相应的对象,结果在 Java 中我应该得到:java.lang.NullPointerException
但不是显示此错误 Play 框架崩溃。
任何想法如何不使框架崩溃并首先看到错误?