I have the following three functions:
First I call initialize as part of a plugin command. Then, in the next plugin command on the same event I call Create.
But it it throws the error "cannot read property 'has' of undefined". Where is _questHubs going? Why did it stop existing or become inaccessible?
//----- Quest Hubs manages _questHubs which is a map of quest hubs -----function QuestHubs(hubName) { if(!this._questHubs.has(hubName)) throw new Error("Invalid hubName: " + hubName); return this._questHubs.get(hubName);}QuestHubs.Initialize = function() { if(this._questHubs) throw new Error("Duplicate _questHubs initialization."); this._questHubs = new Map();}QuestHubs.Create = function(hubName) { if(this._questHubs.has(hubName)) throw new Error("Hub name already in use: " + hubName); this._questHubs.set(hubName, new QuestHub());}First I call initialize as part of a plugin command. Then, in the next plugin command on the same event I call Create.
But it it throws the error "cannot read property 'has' of undefined". Where is _questHubs going? Why did it stop existing or become inaccessible?