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
|
@@ -65,10 +65,17 @@ async function scanProject() {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
exec(cmd, { maxBuffer: 10 * 1024 * 1024 }, (error, stdout, stderr) => {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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();
|