# HG changeset patch # User Rik # Date 1649095861 25200 # Node ID ac478fdded94c72a43cadcf43ed9ccf272697170 # Parent 3a15bf04cb7f8324e2967d964eb3acd4925b6a61 Ffdisp: Place validation/error code before normal code. * pr-output.cc (Ffdisp): re-arrange code to test for valid stream before continuing with rest of function. diff -r 3a15bf04cb7f -r ac478fdded94 libinterp/corefcn/pr-output.cc --- a/libinterp/corefcn/pr-output.cc Mon Apr 04 10:50:26 2022 -0700 +++ b/libinterp/corefcn/pr-output.cc Mon Apr 04 11:11:01 2022 -0700 @@ -3399,12 +3399,11 @@ std::ostream *osp = os.output_stream (); + if (! osp) + error ("fdisp: stream FID not open for writing"); + octave_value arg = args(1); - - if (osp) - arg.print (*osp); - else - error ("fdisp: stream FID not open for writing"); + arg.print (*osp); return ovl (); }