mirror of
https://github.com/flarum/framework.git
synced 2025-05-23 23:29:57 +08:00
Allow extension of functions that may not be defined
This commit is contained in:
@ -22,7 +22,7 @@ export function extend(object, method, callback) {
|
||||
const original = object[method];
|
||||
|
||||
object[method] = function(...args) {
|
||||
const value = original.apply(this, args);
|
||||
const value = original ? original.apply(this, args) : undefined;
|
||||
|
||||
callback.apply(this, [value].concat(args));
|
||||
|
||||
|
Reference in New Issue
Block a user