Fix documentation loading code.

This commit is contained in:
Danila Fedorin 2017-08-08 13:47:03 -07:00
parent 8c3de54d0c
commit fdcf2b5c6d
1 changed files with 10 additions and 2 deletions

View File

@ -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;
}
/**