Skip to content

Commit

Permalink
[[FIX]] Change library validation (#1)
Browse files Browse the repository at this point in the history
Change the way we detect a library is ok.
  • Loading branch information
palmerabollo authored and jmendiara committed Dec 2, 2016
1 parent 3322a4d commit 1bbc124
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ export class PluginLoader {

protected requireLibrary(libpath: string): BotBuilder.Library {
let lib = require(libpath).default as BotBuilder.Library;
if (lib instanceof BotBuilder.Library === false) {

// XXX this validation could be improved checking that lib instanceof BotBuilder.Library
if (!lib.name) {
logger.warn(`Skip plugin at ${libpath}: not a valid Library`);
return null;
}
Expand Down

0 comments on commit 1bbc124

Please sign in to comment.