mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
id stats checking if stat object really is an object and nothing else
This commit is contained in:
parent
84e6f49f84
commit
bc51f6b934
1 changed files with 7 additions and 3 deletions
|
@ -69,7 +69,7 @@ function Inc(
|
|||
newQuestions: number,
|
||||
allQuestions: number
|
||||
) {
|
||||
if (idStatsData[value] === undefined) {
|
||||
if (typeof idStatsData[value] !== 'object' || idStatsData[value] === null) {
|
||||
idStatsData[value] = {
|
||||
count: 0,
|
||||
newQuestions: 0,
|
||||
|
@ -96,10 +96,14 @@ function AddVisitStat(
|
|||
('0' + (date.getMonth() + 1)).slice(-2) +
|
||||
'-' +
|
||||
('0' + date.getDate()).slice(-2)
|
||||
if (idvStatsData[now] === undefined) {
|
||||
if (typeof idvStatsData[now] !== 'object' || idvStatsData[now] === null) {
|
||||
idvStatsData[now] = {}
|
||||
}
|
||||
if (idvStatsData[now][name] === undefined) {
|
||||
|
||||
if (
|
||||
typeof idvStatsData[now][name] !== 'object' &&
|
||||
idvStatsData[now][name] === null
|
||||
) {
|
||||
idvStatsData[now][name] = {
|
||||
count: 0,
|
||||
newQuestions: 0,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue