mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Builder: Singleton_registry: return null when construction spec not available
https://fedorahosted.org/freeipa/ticket/3235
This commit is contained in:
@@ -276,6 +276,7 @@ define(['dojo/_base/declare',
|
|||||||
!(cs.ctor && typeof cs.ctor === 'function')) {
|
!(cs.ctor && typeof cs.ctor === 'function')) {
|
||||||
throw {
|
throw {
|
||||||
error: 'Build error: missing or invalid ctor or factory',
|
error: 'Build error: missing or invalid ctor or factory',
|
||||||
|
code: 'no-ctor-fac',
|
||||||
spec: cs
|
spec: cs
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,13 +65,12 @@ define(['dojo/_base/declare',
|
|||||||
var obj = this._map[type];
|
var obj = this._map[type];
|
||||||
|
|
||||||
if (!obj) {
|
if (!obj) {
|
||||||
if (!this.builder) {
|
if (!this.builder) return null;
|
||||||
throw {
|
try {
|
||||||
error: 'Object not initialized: missing builder',
|
obj = this._map[type] = this.builder.build(type);
|
||||||
ref: this
|
} catch (e) {
|
||||||
};
|
if (e.code === 'no-ctor-fac') obj = null;
|
||||||
}
|
}
|
||||||
obj = this._map[type] = this.builder.build(type);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
|
|||||||
Reference in New Issue
Block a user