mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-23 11:16:39 +00:00
fix(GUI): Reject drives with null size
Change-type: patch Changelog-entry: Reject drives with null size (fixes pretty-bytes error) Signed-off-by: Lorenzo Alberto Maria Ambrosi <lorenzoa@balena.io>
This commit is contained in:
parent
b298e53fc4
commit
20996b153d
@ -92,7 +92,7 @@ class BlockDeviceAdapter extends EventEmitter {
|
||||
if (drive.busType === 'RAID') {
|
||||
return false
|
||||
}
|
||||
return !drive.error && (options.includeSystemDrives || !drive.isSystem)
|
||||
return !drive.error && Number.isFinite(drive.size) && (options.includeSystemDrives || !drive.isSystem)
|
||||
}).map((drive) => {
|
||||
drive.displayName = drive.device
|
||||
if (/PhysicalDrive/i.test(drive.device) && drive.mountpoints.length) {
|
||||
|
@ -65,7 +65,7 @@ describe('Model: availableDrives', function () {
|
||||
{
|
||||
device: '/dev/sdb',
|
||||
description: 'Foo',
|
||||
size: '14G',
|
||||
size: 14000000000,
|
||||
mountpoints: [ {
|
||||
path: '/mnt/foo'
|
||||
} ],
|
||||
@ -82,7 +82,7 @@ describe('Model: availableDrives', function () {
|
||||
{
|
||||
device: '/dev/sdb',
|
||||
description: 'Foo',
|
||||
size: '14G',
|
||||
size: 14000000000,
|
||||
mountpoints: [ {
|
||||
path: '/mnt/foo'
|
||||
} ],
|
||||
|
@ -118,7 +118,7 @@ describe('Browser: driveScanner', function () {
|
||||
device: '/dev/sdb',
|
||||
displayName: '/dev/sdb',
|
||||
description: 'Foo',
|
||||
size: '14G',
|
||||
size: 14000000000,
|
||||
mountpoints: [
|
||||
{
|
||||
path: '/mnt/foo'
|
||||
@ -131,7 +131,7 @@ describe('Browser: driveScanner', function () {
|
||||
device: '/dev/sdc',
|
||||
displayName: '/dev/sdc',
|
||||
description: 'Bar',
|
||||
size: '14G',
|
||||
size: 14000000000,
|
||||
mountpoints: [
|
||||
{
|
||||
path: '/mnt/bar'
|
||||
@ -158,7 +158,7 @@ describe('Browser: driveScanner', function () {
|
||||
device: '/dev/sdb',
|
||||
displayName: '/dev/sdb',
|
||||
description: 'Foo',
|
||||
size: '14G',
|
||||
size: 14000000000,
|
||||
mountpoints: [
|
||||
{
|
||||
path: '/mnt/foo'
|
||||
@ -172,7 +172,7 @@ describe('Browser: driveScanner', function () {
|
||||
device: '/dev/sdc',
|
||||
displayName: '/dev/sdc',
|
||||
description: 'Bar',
|
||||
size: '14G',
|
||||
size: 14000000000,
|
||||
mountpoints: [
|
||||
{
|
||||
path: '/mnt/bar'
|
||||
@ -230,7 +230,7 @@ describe('Browser: driveScanner', function () {
|
||||
device: '\\\\.\\PHYSICALDRIVE2',
|
||||
displayName: '\\\\.\\PHYSICALDRIVE2',
|
||||
description: 'Foo',
|
||||
size: '14G',
|
||||
size: 14000000000,
|
||||
mountpoints: [],
|
||||
isSystem: false,
|
||||
isRemovable: false
|
||||
@ -239,7 +239,7 @@ describe('Browser: driveScanner', function () {
|
||||
device: '\\\\.\\PHYSICALDRIVE3',
|
||||
displayName: 'F:',
|
||||
description: 'Bar',
|
||||
size: '14G',
|
||||
size: 14000000000,
|
||||
mountpoints: [
|
||||
{
|
||||
path: 'F:'
|
||||
@ -266,7 +266,7 @@ describe('Browser: driveScanner', function () {
|
||||
device: '\\\\.\\PHYSICALDRIVE2',
|
||||
displayName: '\\\\.\\PHYSICALDRIVE2',
|
||||
description: 'Foo',
|
||||
size: '14G',
|
||||
size: 14000000000,
|
||||
mountpoints: [],
|
||||
adapter: 'blockdevice',
|
||||
isSystem: false,
|
||||
@ -276,7 +276,7 @@ describe('Browser: driveScanner', function () {
|
||||
device: '\\\\.\\PHYSICALDRIVE3',
|
||||
displayName: 'F:',
|
||||
description: 'Bar',
|
||||
size: '14G',
|
||||
size: 14000000000,
|
||||
mountpoints: [
|
||||
{
|
||||
path: 'F:'
|
||||
@ -309,7 +309,7 @@ describe('Browser: driveScanner', function () {
|
||||
device: '\\\\.\\PHYSICALDRIVE3',
|
||||
raw: '\\\\.\\PHYSICALDRIVE3',
|
||||
description: 'Bar',
|
||||
size: '14G',
|
||||
size: 14000000000,
|
||||
mountpoints: [
|
||||
{
|
||||
path: 'F:'
|
||||
@ -355,7 +355,7 @@ describe('Browser: driveScanner', function () {
|
||||
device: '\\\\.\\PHYSICALDRIVE3',
|
||||
raw: '\\\\.\\PHYSICALDRIVE3',
|
||||
description: 'Bar',
|
||||
size: '14G',
|
||||
size: 14000000000,
|
||||
mountpoints: [
|
||||
{
|
||||
path: 'F:'
|
||||
|
Loading…
x
Reference in New Issue
Block a user