1
From 76713a74beba78223c7b2d07a5f8c16daf695081 Mon Sep 17 00:00:00 2001
2
From: Giovanni Campagna <gcampagna@src.gnome.org>
3
Date: Mon, 17 Jun 2013 19:36:56 +0000
4
Subject: places-menu: null-check g_volume_get_identifier()
6
Not all volumes have the 'class' identifier (for example MTP doesn't),
7
and we can't apply indexOf on null.
9
diff --git a/extensions/places-menu/placeDisplay.js b/extensions/places-menu/placeDisplay.js
10
index 6d0625b..a501494 100644
11
--- a/extensions/places-menu/placeDisplay.js
12
+++ b/extensions/places-menu/placeDisplay.js
13
@@ -292,8 +292,9 @@ const PlacesManager = new Lang.Class({
14
let volumes = drives[i].get_volumes();
16
for(let j = 0; j < volumes.length; j++) {
17
- if (volumes[j].get_identifier('class').indexOf('network') >= 0) {
18
- networkVolumes.push(volumes[i]);
19
+ let identifier = volumes[j].get_identifier('class');
20
+ if (identifier && identifier.indexOf('network') >= 0) {
21
+ networkVolumes.push(volumes[j]);
23
let mount = volumes[j].get_mount();
25
@@ -308,7 +309,8 @@ const PlacesManager = new Lang.Class({
26
if(volumes[i].get_drive() != null)
29
- if (volumes[i].get_identifier('class').indexOf('network') >= 0) {
30
+ let identifier = volumes[i].get_identifier('class');
31
+ if (identifier && identifier.indexOf('network') >= 0) {
32
networkVolumes.push(volumes[i]);
34
let mount = volumes[i].get_mount();