Skip to content

Commit

Permalink
fixed bug in getDisks since i used mnt before checking if its null.
Browse files Browse the repository at this point in the history
  • Loading branch information
ccadeptic23 committed Mar 2, 2015
1 parent 1c742f0 commit 52c0829
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions DataProviders.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,13 +409,14 @@ DiskDataProvider.prototype = {
var isDisk=true;
var dname = vols[i].get_name();
var mnt = vols[i].get_mount();
var drv = mnt.get_drive();
if(drv!=null)
isDisk = !drv.is_media_removable();
if(mnt!=null && isDisk)

if(mnt!=null)
{
var drv = mnt.get_drive();
if(drv!=null)
isDisk = !drv.is_media_removable();
var mntroot = mnt.get_root();
if(this.disabledDevices.indexOf(dname) == -1) //device is enabled
if(isDisk && this.disabledDevices.indexOf(dname) == -1) //device is enabled, and is a disk
volDirs[dname] = mntroot.get_path();
}

Expand Down

0 comments on commit 52c0829

Please sign in to comment.