diff --git a/programs/disks/CommandWrite.cpp b/programs/disks/CommandWrite.cpp index f4e1c892aad..1d61809afb6 100644 --- a/programs/disks/CommandWrite.cpp +++ b/programs/disks/CommandWrite.cpp @@ -35,12 +35,13 @@ public: { if (!path_from.has_value()) return std::make_unique(STDIN_FILENO); - String relative_path_from = disk.getRelativeFromRoot(path_from.value()); - auto res = disk.getDisk()->readFileIfExists(relative_path_from, getReadSettings()); - if (res) - return res; - /// For backward compatibility. - return std::make_unique(); + + String relative_path_from = disk.getRelativeFromRoot(path_from.value()); + auto res = disk.getDisk()->readFileIfExists(relative_path_from, getReadSettings()); + if (res) + return res; + /// For backward compatibility. + return std::make_unique(); }(); auto out = disk.getDisk()->writeFile(path_to);