[gnome-weather/bilelmoussaoui/location-portal: 1/2] location: check if the client exists before using it




commit 75be090a35f9ea9a99e09649c684b88d8910c9c2
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Wed Jan 12 10:38:32 2022 +0100

    location: check if the client exists before using it
    
    GeoClue doesn't make use of a client proxy if the app is sandboxed

 src/app/currentLocationController.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/app/currentLocationController.js b/src/app/currentLocationController.js
index 8c5d1f5..64aa2e4 100644
--- a/src/app/currentLocationController.js
+++ b/src/app/currentLocationController.js
@@ -80,7 +80,8 @@ var CurrentLocationController = class CurrentLocationController {
             return;
         }
 
-        if (!Geoclue.Simple.new_with_thresholds) {
+        // geoclue doesn't use a client proxy inside a flatpak sandbox
+        if (this._simple.client && !Geoclue.Simple.new_with_thresholds) {
             let client = this._simple.get_client();
             client.distance_threshold = 100;
         }


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