Skip to content

Commit

Permalink
Fixed bug: next is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
mansoor-omrani committed Jan 5, 2021
1 parent 1d4764b commit 3c28c96
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion index.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,10 @@ var ChainLogger = /*#__PURE__*/function (_LoggerBase) {
return this._next;
},
set: function set(value) {
(0, _locustjsException.throwIfNull)(next, 'value');
if ((0, _locustjsBase.isNull)(value)) {
value = new NullLogger();
}

(0, _locustjsException.throwIfNotInstanceOf)('value', LoggerBase, value);
this._next = value;
}
Expand Down
6 changes: 4 additions & 2 deletions index.esm.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { isEmpty, isObject, isString, isSomeString, isFunction, isjQueryElement, isNull } from 'locustjs-base';
import {
Exception,
throwIfNull,
throwIfNotInstanceOf,
throwIfInstantiateAbstract,
throwNotImplementedException
Expand Down Expand Up @@ -140,7 +139,10 @@ class ChainLogger extends LoggerBase {
return this._next;
}
set next(value) {
throwIfNull(next, 'value');
if (isNull(value)) {
value = new NullLogger();
}

throwIfNotInstanceOf('value', LoggerBase, value);

this._next = value;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "locustjs-logging",
"version": "1.0.8",
"version": "1.0.9",
"description": "This library provides various types of loggers that could be employed in any type of front-end application.",
"main": "index.cjs.js",
"module": "index.esm.js",
Expand Down

0 comments on commit 3c28c96

Please sign in to comment.