Browse Source

Merge pull request #4677 from RaananW/bug-fixes

Bug fixes
Raanan Weber 7 years ago
parent
commit
b06416c56d
2 changed files with 5 additions and 5 deletions
  1. 2 2
      Viewer/src/helper/index.ts
  2. 3 3
      Viewer/src/viewer/viewer.ts

+ 2 - 2
Viewer/src/helper/index.ts

@@ -40,8 +40,8 @@ export function camelToKebab(str) {
  * @param config the configuration object that will extend the object
  */
 export function extendClassWithConfig(object: any, config: any) {
-    if (!config) return;
-    Object.keys(config).forEach(key => {
+    if (!config || typeof config !== 'object') return;
+    Object.keys(config).forEach(function (key) {
         if (key in object && typeof object[key] !== 'function') {
             // if (typeof object[key] === 'function') return;
             // if it is an object, iterate internally until reaching basic types

+ 3 - 3
Viewer/src/viewer/viewer.ts

@@ -174,9 +174,6 @@ export abstract class AbstractViewer {
 
         this._configurationContainer = new ConfigurationContainer();
 
-        // add this viewer to the viewer manager
-        viewerManager.addViewer(this);
-
         this.observablesManager = new ObservablesManager();
 
         this.modelLoader = new ModelLoader(this.observablesManager, this._configurationContainer);
@@ -200,6 +197,9 @@ export abstract class AbstractViewer {
 
         this._prepareContainerElement();
 
+        // add this viewer to the viewer manager
+        viewerManager.addViewer(this);
+
     }
 
     /**