muaddib-scanner 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muaddib-scanner",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Supply-chain threat detection & response for npm",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -65,10 +65,17 @@ async function scanProject() {
65
65
  }
66
66
 
67
67
  exec(cmd, { maxBuffer: 10 * 1024 * 1024 }, (error, stdout, stderr) => {
68
- try {
69
- const result = JSON.parse(stdout);
70
- displayResults(result, projectPath);
71
- } catch (e) {
68
+ try {
69
+ // Si pas de JSON valide, c'est que le scan est propre
70
+ if (!stdout || !stdout.trim().startsWith('{')) {
71
+ vscode.window.showInformationMessage('MUAD\'DIB: Aucune menace detectee');
72
+ diagnosticCollection.clear();
73
+ resolve();
74
+ return;
75
+ }
76
+ const result = JSON.parse(stdout);
77
+ displayResults(result, projectPath);
78
+ } catch (e) {
72
79
  if (stdout.includes('Aucune menace')) {
73
80
  vscode.window.showInformationMessage('MUAD\'DIB: Aucune menace detectee');
74
81
  diagnosticCollection.clear();