Skip to content

Commit

Permalink
Report file not found errors, for file contexts.
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Piolat committed Nov 9, 2021
1 parent deeb01f commit 526170d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/audioformats/stream.d
Original file line number Diff line number Diff line change
Expand Up @@ -1078,6 +1078,8 @@ struct FileContext // this is what is passed to I/O when used in file mode
{
CString strZ = CString(path);
file = fopen(strZ.storage, forWrite ? "wb".ptr : "rb".ptr);
if (file is null)
throw mallocNew!Exception("File not found");
// finds the size of the file
fseek(file, 0, SEEK_END);
fileSize = ftell(file);
Expand Down

0 comments on commit 526170d

Please sign in to comment.