@syncfusion/ej2-base 29.1.33 → 29.1.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3881,17 +3881,19 @@ function getComponent(elem, comp) {
3881
3881
  var instance;
3882
3882
  var i;
3883
3883
  var ele = typeof elem === 'string' ? document.getElementById(elem) : elem;
3884
- for (i = 0; i < ele.ej2_instances.length; i++) {
3885
- instance = ele.ej2_instances[parseInt(i.toString(), 10)];
3886
- if (typeof comp === 'string') {
3887
- var compName = instance.getModuleName();
3888
- if (comp === compName) {
3889
- return instance;
3884
+ if (ele && ele.ej2_instances) {
3885
+ for (i = 0; i < ele.ej2_instances.length; i++) {
3886
+ instance = ele.ej2_instances[parseInt(i.toString(), 10)];
3887
+ if (typeof comp === 'string') {
3888
+ var compName = instance.getModuleName();
3889
+ if (comp === compName) {
3890
+ return instance;
3891
+ }
3890
3892
  }
3891
- }
3892
- else {
3893
- if (instance instanceof comp) {
3894
- return instance;
3893
+ else {
3894
+ if (instance instanceof comp) {
3895
+ return instance;
3896
+ }
3895
3897
  }
3896
3898
  }
3897
3899
  }