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;
|
return this.notifyTasks;
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void addPlotTask(Plot plot, UniqueStatement task) {
|
public synchronized void addPlotTask(@NotNull Plot plot, UniqueStatement task) {
|
||||||
if (plot == null) {
|
|
||||||
plot = new Plot(null, new PlotId(Integer.MAX_VALUE, Integer.MAX_VALUE));
|
|
||||||
}
|
|
||||||
Queue<UniqueStatement> tasks = this.plotTasks.get(plot);
|
Queue<UniqueStatement> tasks = this.plotTasks.get(plot);
|
||||||
if (tasks == null) {
|
if (tasks == null) {
|
||||||
tasks = new ConcurrentLinkedQueue<>();
|
tasks = new ConcurrentLinkedQueue<>();
|
||||||
|
@ -204,7 +204,7 @@ public class Plot {
|
|||||||
* @param id the plot id
|
* @param id the plot id
|
||||||
* @see Plot#getPlot(Location) for existing plots
|
* @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);
|
this(area, id, null, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ import java.util.List;
|
|||||||
public class InboxReport extends CommentInbox {
|
public class InboxReport extends CommentInbox {
|
||||||
|
|
||||||
@Override public boolean getComments(Plot plot, final RunnableVal<List<PlotComment>> whenDone) {
|
@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) {
|
@Override public void run(List<PlotComment> value) {
|
||||||
whenDone.value = value;
|
whenDone.value = value;
|
||||||
TaskManager.runTask(whenDone);
|
TaskManager.runTask(whenDone);
|
||||||
|
Loading…
Reference in New Issue
Block a user