Protection added for volumes with undefined medium
(cherry picked from commit a044372ddc4031e42f35c82c88308615e26ebac6)