Skip to content

Commit

Permalink
fixed an exception for workspot files
Browse files Browse the repository at this point in the history
  • Loading branch information
manavortex committed Nov 27, 2023
1 parent 2670395 commit dd9d91c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Scripts/hook_global.wscript
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ globalThis.onSave = function (ext, file) {
// either we have nothing to write or we aren't supposed to write => abort
if (!FileValidation.isDataChangedForWriting || Settings.DisableAutofix) return retSuccess;

const filePath = wkit.GetActiveDocument().FilePath;

// unless it's a workspot, automatically close and re-open it
if (!fileName.endsWith('workspot') || Settings.Workspot.autoReopenFile) {
try {
const filePath = wkit.GetActiveDocument().FilePath;
Logger.Info(`Filevalidation: Reopening ${filePath} for you…`);
wkit.GetActiveDocument().Close();
wkit.OpenDocument(filePath);
Expand Down

0 comments on commit dd9d91c

Please sign in to comment.