Properly error out if passed an id that doesn't exist.
Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
| ... | ... |
@@ -847,6 +847,9 @@ func (devices *DeviceSet) UnmountDevice(hash string, mode UnmountMode) error {
|
| 847 | 847 |
defer devices.Unlock() |
| 848 | 848 |
|
| 849 | 849 |
info := devices.Devices[hash] |
| 850 |
+ if info == nil {
|
|
| 851 |
+ return fmt.Errorf("UnmountDevice: no such device %s\n", hash)
|
|
| 852 |
+ } |
|
| 850 | 853 |
|
| 851 | 854 |
if mode == UnmountFloat {
|
| 852 | 855 |
if info.floating {
|