mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 14:27:33 -08:00
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:
commit
5073c3389f
|
@ -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']);
|
||||
|
|
Loading…
Reference in a new issue