فهرست منبع

Fix bug of non-existing key

Shendan JIN 8 سال پیش
والد
کامیت
813038c822
1فایلهای تغییر یافته به همراه4 افزوده شده و 3 حذف شده
  1. 4 3
      gcal.py

+ 4 - 3
gcal.py

@@ -89,10 +89,11 @@ def main():
         print('  Updatedtime:', event['updated'])
         
         #summary:   the description of the event
-        print('  Description:', event['description'])
+        if ('description' in event):
+            print('  Description:', event['description'])
         
-
-        print('  Location:', event['location'])
+        if ('location' in event):
+            print('  Location:', event['location'])
 
         print("  Organizer's name:", event['organizer']['displayName'])
         print("  Organizer's email:", event['organizer']['email'])