Merge pull request #13821 from snipe/bug/rb-17462

More graceful failure if ldap_results JSON decode isn’t set
This commit is contained in:
snipe 2023-10-31 17:11:14 +00:00 committed by GitHub
commit 5073c3389f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -56,6 +56,10 @@ class LDAPImportController extends Controller
$ldap_results_json = Artisan::output();
$ldap_results = json_decode($ldap_results_json, true);
if (!$ldap_results) {
return redirect()->back()->withInput()->with('error', trans('general.no_results'));
}
// Direct user to appropriate status page.
if ($ldap_results['error']) {
return redirect()->back()->withInput()->with('error', $ldap_results['error_message']);