Fix NullPointerException

This commit is contained in:
unlimmitted 2024-09-21 16:50:56 +03:00
parent 75a140f79f
commit bfbe50732d
1 changed files with 16 additions and 12 deletions

View File

@ -255,6 +255,7 @@ public final class ApiConnectionImpl extends ApiConnection {
} catch (MikrotikApiException ex) { } catch (MikrotikApiException ex) {
continue; continue;
} }
if (res.getTag() != null) {
ResultListener l = listeners.get(res.getTag()); ResultListener l = listeners.get(res.getTag());
if (l != null) { if (l != null) {
if (res instanceof Result) { if (res instanceof Result) {
@ -270,6 +271,9 @@ public final class ApiConnectionImpl extends ApiConnection {
l.error(new ApiCommandException((Error) res)); l.error(new ApiCommandException((Error) res));
} }
} }
} else {
nextTag();
}
} }
} }