From fdcf2b5c6d371f973a9ee4df850d3440f27fff65 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Tue, 8 Aug 2017 13:47:03 -0700 Subject: [PATCH] Fix documentation loading code. --- .../java/org/nwapw/abacus/plugin/PluginManager.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/nwapw/abacus/plugin/PluginManager.java b/src/main/java/org/nwapw/abacus/plugin/PluginManager.java index e6d4953..390b9e8 100644 --- a/src/main/java/org/nwapw/abacus/plugin/PluginManager.java +++ b/src/main/java/org/nwapw/abacus/plugin/PluginManager.java @@ -147,10 +147,18 @@ public class PluginManager { * @return the documentation object. */ public Documentation documentationFor(String name, DocumentationType type){ + Documentation toReturn = null; for(Documentation entry : registeredDocumentation){ - if(entry.getCodeName().equals(name) && entry.getType() == type) return entry; + if(entry.getCodeName().equals(name) && entry.getType() == type) { + toReturn = entry; + break; + } } - return null; + if(toReturn == null){ + toReturn = new Documentation(name, "", "", "", type); + registerDocumentation(toReturn); + } + return toReturn; } /**