From 455f10f8157568d8b95fc3275f8aa1838984d45d Mon Sep 17 00:00:00 2001 From: James Date: Thu, 27 Oct 2011 14:34:03 -0400 Subject: [PATCH] CC-2954: Exception in media monitor using Dropbox - This will take care of the exception issue --- .../airtimefilemonitor/mediamonitorcommon.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/python_apps/media-monitor/airtimefilemonitor/mediamonitorcommon.py b/python_apps/media-monitor/airtimefilemonitor/mediamonitorcommon.py index bf0ab3f8e..0bb86755b 100644 --- a/python_apps/media-monitor/airtimefilemonitor/mediamonitorcommon.py +++ b/python_apps/media-monitor/airtimefilemonitor/mediamonitorcommon.py @@ -26,9 +26,14 @@ class MediaMonitorCommon: def is_temp_file(self, filename): info = filename.split(".") - - if(info[-2] in self.supported_file_formats): - return True + + # if file doesn't have any extension, info[-2] throws exception + # Hence, checking length of info before we do anything + if(len(info) >= 3): + if(info[-2] in self.supported_file_formats): + return True + else: + return False else: return False