mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-12-17 20:54:40 +03:00
Fix critical bugs in ObjectUtil.equals() and filterInbounds() functions (#3451)
* Initial plan * Fix ObjectUtil.equals asymmetric comparison and filterInbounds null pointer bugs Co-authored-by: MHSanaei <33454419+MHSanaei@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: MHSanaei <33454419+MHSanaei@users.noreply.github.com>
This commit is contained in:
@@ -326,6 +326,14 @@ class ObjectUtil {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (const key in b) {
|
||||||
|
if (!b.hasOwnProperty(key)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!a.hasOwnProperty(key)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -983,11 +983,13 @@
|
|||||||
const list = this.clientCount[inbound.id][this.filterBy];
|
const list = this.clientCount[inbound.id][this.filterBy];
|
||||||
if (list.length > 0) {
|
if (list.length > 0) {
|
||||||
const filteredSettings = { "clients": [] };
|
const filteredSettings = { "clients": [] };
|
||||||
inboundSettings.clients.forEach(client => {
|
if (inboundSettings.clients) {
|
||||||
if (list.includes(client.email)) {
|
inboundSettings.clients.forEach(client => {
|
||||||
filteredSettings.clients.push(client);
|
if (list.includes(client.email)) {
|
||||||
}
|
filteredSettings.clients.push(client);
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
newInbound.settings = Inbound.Settings.fromJson(inbound.protocol, filteredSettings);
|
newInbound.settings = Inbound.Settings.fromJson(inbound.protocol, filteredSettings);
|
||||||
this.searchedInbounds.push(newInbound);
|
this.searchedInbounds.push(newInbound);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user