Skip to content

Commit a96ba3d

Browse files
committed
Add error handling for file loading in SelectFile action
1 parent 9c8a0e1 commit a96ba3d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Source/Processors/FileReader/FileReaderActions.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,14 @@ bool SelectFile::perform()
4848
pathParam->setNextValue (newPath, false);
4949

5050
// Load the new file
51-
processor->setFile (newPath, false);
51+
bool success = processor->setFile (newPath, false);
52+
53+
if (!success)
54+
{
55+
// If loading the file failed, revert the path parameter to the original path
56+
pathParam->setNextValue (originalPath, false);
57+
return false;
58+
}
5259

5360
// Set the active stream to the first stream
5461
processor->setActiveStream (0, true);

0 commit comments

Comments
 (0)