[gnome-shell] modemManager: improve check for CDMA system identifier



commit 96c24733177a5bb2ea43179ee321cb507b6cd651
Author: Cosimo Cecchi <cosimo endlessm com>
Date:   Sun May 26 09:54:42 2019 -0700

    modemManager: improve check for CDMA system identifier
    
    Upon construction of the CDMA modem proxy, _reloadCdmaOperatorName()
    is called and the value of the Sid property is read.
    That property is defined as UINT32 in the D-Bus interface, but the
    value may not be loaded yet after the proxy is constructed, in which
    case its value will be null.
    
    In _findProviderForSid(), we'll end up calling lookup_cdma_sid(null)
    which fails with the following assertion:
    
    gnome-shell[1082]: nma_mobile_providers_database_lookup_cdma_sid: assertion 'sid > 0' failed
    
    This commit changes the (sid == 0) check in _findProviderForSid()
    to (!sid) which will also catch the null case.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/555

 js/misc/modemManager.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/js/misc/modemManager.js b/js/misc/modemManager.js
index 7c6c39a73..33088644d 100644
--- a/js/misc/modemManager.js
+++ b/js/misc/modemManager.js
@@ -71,7 +71,7 @@ function _findProviderForMccMnc(operator_name, operator_code) {
 // Tries to find the operator name corresponding to the given SID
 //
 function _findProviderForSid(sid) {
-    if (sid == 0)
+    if (!sid)
         return null;
 
     let mpd = _getMobileProvidersDatabase();


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