prevent crash on empty shell cmd with $ or ! (#240)
This commit is contained in:
parent
a386841947
commit
ca53565240
|
@ -41,7 +41,12 @@ export const useShellCommandProcessor = (
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Remove symbol from rawQuery
|
// Remove symbol from rawQuery
|
||||||
const trimmed = rawQuery.trim().slice(1);
|
const trimmed = rawQuery.trim().slice(1).trimStart();
|
||||||
|
|
||||||
|
// Stop if command is empty
|
||||||
|
if (!trimmed) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Add user message *before* execution starts
|
// Add user message *before* execution starts
|
||||||
const userMessageTimestamp = Date.now();
|
const userMessageTimestamp = Date.now();
|
||||||
|
|
Loading…
Reference in New Issue