1
0
mirror of https://github.com/DanilaFe/abacus synced 2024-11-17 16:09:32 -08:00

Fix documentation loading code.

This commit is contained in:
Danila Fedorin 2017-08-08 13:47:03 -07:00
parent 8c3de54d0c
commit fdcf2b5c6d

View File

@ -147,10 +147,18 @@ public class PluginManager {
* @return the documentation object. * @return the documentation object.
*/ */
public Documentation documentationFor(String name, DocumentationType type){ public Documentation documentationFor(String name, DocumentationType type){
Documentation toReturn = null;
for(Documentation entry : registeredDocumentation){ 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;
} }
/** /**