File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,8 @@ struct CmdCatNar : StoreCommand, MixCat
7676 void run (ref<Store> store) override
7777 {
7878 AutoCloseFD fd = open (narPath.c_str (), O_RDONLY);
79+ if (!fd)
80+ throw SysError (" opening NAR file '%s'" , narPath);
7981 auto source = FdSource{fd.get ()};
8082 auto narAccessor = makeNarAccessor (source);
8183 auto listing = listNar (narAccessor, CanonPath::root, true );
Original file line number Diff line number Diff line change @@ -146,6 +146,8 @@ struct CmdLsNar : Command, MixLs
146146 void run () override
147147 {
148148 AutoCloseFD fd = open (narPath.c_str (), O_RDONLY);
149+ if (!fd)
150+ throw SysError (" opening NAR file '%s'" , narPath);
149151 auto source = FdSource{fd.get ()};
150152 auto narAccessor = makeNarAccessor (source);
151153 auto listing = listNar (narAccessor, CanonPath::root, true );
You can’t perform that action at this time.
0 commit comments