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')) {
|
||||
throw {
|
||||
error: 'Build error: missing or invalid ctor or factory',
|
||||
code: 'no-ctor-fac',
|
||||
spec: cs
|
||||
};
|
||||
}
|
||||
|
||||
@@ -65,13 +65,12 @@ define(['dojo/_base/declare',
|
||||
var obj = this._map[type];
|
||||
|
||||
if (!obj) {
|
||||
if (!this.builder) {
|
||||
throw {
|
||||
error: 'Object not initialized: missing builder',
|
||||
ref: this
|
||||
};
|
||||
if (!this.builder) return null;
|
||||
try {
|
||||
obj = this._map[type] = this.builder.build(type);
|
||||
} catch (e) {
|
||||
if (e.code === 'no-ctor-fac') obj = null;
|
||||
}
|
||||
obj = this._map[type] = this.builder.build(type);
|
||||
}
|
||||
|
||||
return obj;
|
||||
|
||||
Reference in New Issue
Block a user