[gnome-shell] calendar: Avoid a warning



commit c765082f72d69ea2880f93cdb26466e310552cb4
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Jul 12 05:25:54 2019 +0200

    calendar: Avoid a warning
    
    We will always get a results array from gjs' proxy wrapper, but it
    will be empty in the error case; that is, `results` is always defined,
    but `results[0]` may not be.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/626

 js/ui/calendar.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/js/ui/calendar.js b/js/ui/calendar.js
index 3371004fc..01a56baee 100644
--- a/js/ui/calendar.js
+++ b/js/ui/calendar.js
@@ -237,7 +237,7 @@ var DBusEventSource = class DBusEventSource {
 
     _onEventsReceived(results, error) {
         let newEvents = [];
-        let appointments = results ? results[0] : null;
+        let appointments = results[0] || null;
         if (appointments != null) {
             for (let n = 0; n < appointments.length; n++) {
                 let a = appointments[n];


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]