Skip to content

Commit

Permalink
If you tried to use Alt-F (optimize along the line of variation) when…
Browse files Browse the repository at this point in the history
… there wasn't a for-real least-squares solution, a NULL pointer was accessed and it would segfault. Now, you get an error message and no crash.
  • Loading branch information
Bill-Gray committed Mar 30, 2023
1 parent 7cfe9f3 commit 9588a5b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions findorb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5207,12 +5207,18 @@ int main( int argc, const char **argv)
case ALT_F:
{
extern double **eigenvects;
const double n_sigmas = improve_along_lov( orbit, curr_epoch,

if( eigenvects && eigenvects[0])
{
const double n_sigmas = improve_along_lov( orbit, curr_epoch,
eigenvects[0], n_orbit_params, n_obs, obs);

snprintf( message_to_user, sizeof( message_to_user),
snprintf( message_to_user, sizeof( message_to_user),
"Adjusted by %f sigmas", n_sigmas);
update_element_display = 1;
update_element_display = 1;
}
else
strlcpy_error( message_to_user, "No LOV along which to improve");
}
break;
case CTRL( 'D'):
Expand Down

0 comments on commit 9588a5b

Please sign in to comment.