Skip to content

Commit c7a85a6

Browse files
committed
Add null check
1 parent dbbb1cf commit c7a85a6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

laboratory/resources/web/laboratory/panel/ProjectFilterType.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Ext4.define('Laboratory.panel.ProjectFilterType', {
109109

110110
isValid: function(){
111111
var val = this.down('#projectField').getValue();
112-
if(!val || !val.length){
112+
if (!val || !val.length){
113113
return false;
114114
}
115115

@@ -140,10 +140,11 @@ Ext4.define('Laboratory.panel.ProjectFilterType', {
140140

141141
getProjects: function(){
142142
var projectArray = this.down('#projectField').getValue();
143-
if (projectArray || !Ext4.isArray(projectArray))
143+
if (projectArray && !Ext4.isArray(projectArray)) {
144144
projectArray = [projectArray];
145+
}
145146

146-
if (projectArray.length > 0){
147+
if (projectArray && projectArray.length > 0){
147148
projectArray = Ext4.unique(projectArray);
148149
projectArray.sort();
149150
}

0 commit comments

Comments
 (0)