Skip to content

Commit 0081b01

Browse files
authored
Merge pull request #143 from ARMmbed/win7_fix
Fix issue were a method is attempted to be called on a NoneType.
2 parents 80e32da + 716179d commit 0081b01

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mbed_lstools/lstools_win7.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ def get_mbeds(self):
161161
for mbed in self.get_mbed_devices():
162162
mountpoint = re.match('.*\\\\(.:)$', mbed[0]).group(1)
163163
# TargetID is a hex string with 10-48 chars
164-
tid = re.search('[&#]([0-9A-Za-z]{10,48})[&#]', mbed[1]).group(1)
164+
m = re.search('[&#]([0-9A-Za-z]{10,48})[&#]', mbed[1])
165+
if not m:
166+
continue
167+
tid = m.group(1)
165168
mbeds += [(mountpoint, tid)]
166169
self.debug(self.get_mbeds.__name__, (mountpoint, tid))
167170
return mbeds

0 commit comments

Comments
 (0)