Skip to content

Commit 77347f2

Browse files
committed
check sid attribute exists first
1 parent 22c5f97 commit 77347f2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

climada/hazard/tc_tracks.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ def get_track(self, track_name=None):
122122
return self.data
123123

124124
for track in self.data:
125-
if track.name == track_name or track.sid == track_name:
125+
if track.name == track_name:
126+
return track
127+
if hasattr(track, 'sid') and track.sid == track_name:
126128
return track
127129

128130
LOGGER.info('No track with name %s found.', track_name)

0 commit comments

Comments
 (0)