Skip to content

Commit 58a2f21

Browse files
author
Aschen
committed
Check parent controller name
1 parent 8b7ee47 commit 58a2f21

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Kuzzle.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const
99
ServerController = require('./controllers/server'),
1010
SecurityController = require('./controllers/security'),
1111
MemoryStorageController = require('./controllers/memoryStorage'),
12-
BaseController = require('./controllers/base'),
1312
uuidv4 = require('./uuidv4'),
1413
proxify = require('./proxify');
1514

@@ -517,7 +516,7 @@ Discarded request: ${JSON.stringify(request)}`));
517516
* @returns {Kuzzle}
518517
*/
519518
useController (ControllerClass, accessor) {
520-
if (!(ControllerClass.prototype instanceof BaseController)) {
519+
if (!(ControllerClass.prototype.__proto__.constructor.name === 'BaseController')) {
521520
throw new Error('Controllers must inherits from the BaseController class.');
522521
}
523522

0 commit comments

Comments
 (0)