From 846b48655b9c6f0a7d2f41f91fbc079cfe9a0cef Mon Sep 17 00:00:00 2001 From: Jan-Piet Mens Date: Tue, 11 Jun 2013 07:08:55 +0200 Subject: [PATCH] Protect None value in setup module --- system/setup | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/system/setup b/system/setup index 274fb469ee9..edc27d22205 100644 --- a/system/setup +++ b/system/setup @@ -619,9 +619,10 @@ class LinuxHardware(Hardware): d['rotational'] = get_file_content(sysdir + "/queue/rotational") d['scheduler_mode'] = "" scheduler = get_file_content(sysdir + "/queue/scheduler") - m = re.match(".*?(\[(.*)\])", scheduler) - if m: - d['scheduler_mode'] = m.group(2) + if scheduler is not None: + m = re.match(".*?(\[(.*)\])", scheduler) + if m: + d['scheduler_mode'] = m.group(2) d['sectors'] = get_file_content(sysdir + "/size") if not d['sectors']: