mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 22:56:45 +01:00
Prevent NPE for report comments
This commit is contained in:
parent
caa4a08b26
commit
5bd53436df
@ -248,10 +248,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
return this.notifyTasks;
|
||||
}
|
||||
|
||||
public synchronized void addPlotTask(Plot plot, UniqueStatement task) {
|
||||
if (plot == null) {
|
||||
plot = new Plot(null, new PlotId(Integer.MAX_VALUE, Integer.MAX_VALUE));
|
||||
}
|
||||
public synchronized void addPlotTask(@NotNull Plot plot, UniqueStatement task) {
|
||||
Queue<UniqueStatement> tasks = this.plotTasks.get(plot);
|
||||
if (tasks == null) {
|
||||
tasks = new ConcurrentLinkedQueue<>();
|
||||
|
@ -204,7 +204,7 @@ public class Plot {
|
||||
* @param id the plot id
|
||||
* @see Plot#getPlot(Location) for existing plots
|
||||
*/
|
||||
public Plot(PlotArea area, @NotNull PlotId id) {
|
||||
public Plot(@NotNull PlotArea area, @NotNull PlotId id) {
|
||||
this(area, id, null, 0);
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ import java.util.List;
|
||||
public class InboxReport extends CommentInbox {
|
||||
|
||||
@Override public boolean getComments(Plot plot, final RunnableVal<List<PlotComment>> whenDone) {
|
||||
DBFunc.getComments(null, toString(), new RunnableVal<List<PlotComment>>() {
|
||||
DBFunc.getComments(plot, toString(), new RunnableVal<List<PlotComment>>() {
|
||||
@Override public void run(List<PlotComment> value) {
|
||||
whenDone.value = value;
|
||||
TaskManager.runTask(whenDone);
|
||||
|
Loading…
Reference in New Issue
Block a user