Skip to content

Commit 339b121

Browse files
committed
Fix location crashing on 7 and earlier
1 parent a735e06 commit 339b121

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

dom/geolocation/GeolocationSystemWin.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "mozilla/Components.h"
99
#include "mozilla/dom/BrowsingContext.h"
1010
#include "mozilla/ScopeExit.h"
11+
#include "mozilla/WindowsVersion.h"
1112
#include "nsIGeolocationUIUtilsWin.h"
1213
#include "nsIWifiListener.h"
1314
#include "nsIWifiMonitor.h"
@@ -34,6 +35,7 @@ const wchar_t kLocationSettingsPage[] = L"ms-settings:privacy-location";
3435

3536
template <typename TypeToCreate>
3637
ComPtr<TypeToCreate> CreateFromActivationFactory(const wchar_t* aNamespace) {
38+
if (!IsWin11OrLater()) return {};
3739
ComPtr<TypeToCreate> newObject;
3840
GetActivationFactory(HStringReference(aNamespace).Get(), &newObject);
3941
return newObject;

0 commit comments

Comments
 (0)