Skip to content

Commit

Permalink
Do not crash when importing non-utf8 .txt files
Browse files Browse the repository at this point in the history
  • Loading branch information
luboslenco committed May 14, 2023
1 parent c618aaa commit 5759780
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 23 deletions.
20 changes: 0 additions & 20 deletions armorpaint/Assets/plugins/import_txt.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
let import_txt = function(path, done) {
iron.Data.getBlob(path, function(b) {
var filename = path.split('\\').pop().split('/').pop();
arm.UIBox.showMessage(filename, b.toString(), true);
arm.UIBox.clickToHide = false;
iron.Data.deleteBlob(path);
try {
arm.UIBox.showMessage(filename, b.toString(), true);
arm.UIBox.clickToHide = false;
iron.Data.deleteBlob(path);
}
catch(e) {
console.error(e);
}
});
}

Expand Down
1 change: 1 addition & 0 deletions base/khafile.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ project.addShaders("Shaders/*.glsl", { embed: flags.snapshot });
project.addAssets("Assets/*", { destination: "data/{name}", embed: flags.snapshot });
project.addAssets("Assets/locale/*", { destination: "data/locale/{name}" });
project.addAssets("Assets/licenses/**", { destination: "data/licenses/{name}" });
project.addAssets("Assets/plugins/*", { destination: "data/plugins/{name}" });
project.addAssets("Assets/themes/*.json", { destination: "data/themes/{name}" });

if (flags.snapshot) {
Expand Down

0 comments on commit 5759780

Please sign in to comment.