Skip to content

Commit

Permalink
fix edge-case crash in enclosure_class.py (#14353)
Browse files Browse the repository at this point in the history
(cherry picked from commit c047b4a)

Co-authored-by: caleb <[email protected]>
  • Loading branch information
bugclerk and yocalebo authored Aug 27, 2024
1 parent 52561ce commit b9b4235
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def is_rseries(self):
Args:
Returns: bool
"""
return all((self.controller, self.model[0] == 'R'))
return all((self.controller, self.model and self.model[0] == 'R'))

@property
def is_r10(self):
Expand Down Expand Up @@ -457,7 +457,7 @@ def is_fseries(self):
Args:
Returns: bool
"""
return all((self.controller, self.model[0] == 'F'))
return all((self.controller, self.model and self.model[0] == 'F'))

@property
def is_hseries(self):
Expand All @@ -466,7 +466,7 @@ def is_hseries(self):
Args:
Returns: bool
"""
return all((self.controller, self.model[0] == 'H'))
return all((self.controller, self.model and self.model[0] == 'H'))

@property
def is_mseries(self):
Expand All @@ -476,7 +476,7 @@ def is_mseries(self):
Returns: bool
"""
return all((
self.controller, not self.is_mini, self.model[0] == 'M'
self.controller, not self.is_mini, self.model and self.model[0] == 'M'
))

@property
Expand All @@ -487,7 +487,7 @@ def is_xseries(self):
Returns: bool
"""
return all((
self.controller, self.model[0] == 'X'
self.controller, self.model and self.model[0] == 'X'
))

@property
Expand Down

0 comments on commit b9b4235

Please sign in to comment.