Commit c5117b2
Fix/handle missing src dst in traffic entries (#127)
* fix: guard against undefined src/dst in traffic entries
Some exitTraffic entries from the Tailscale API omit the src field,
causing a TypeError (Cannot read properties of undefined reading
'startsWith') in isIPAddress() which crashes the entire data loading
pipeline.
Changes:
- Add null guard to isIPAddress() to return false for falsy input
- Skip traffic entries with missing src or dst in processNetworkLogs()
- Add null guards to extractIP() and extractPort() in ip-utils.ts
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: guard against null IP values
* fix: add comment about fix to guard against null values
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 28b06b3 commit c5117b2
2 files changed
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| |||
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| 25 | + | |
| 26 | + | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
| |||
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
48 | 55 | | |
49 | 56 | | |
50 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
144 | 146 | | |
145 | 147 | | |
146 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
147 | 153 | | |
148 | 154 | | |
149 | 155 | | |
| |||
0 commit comments