1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-11-24 07:30:19 +01:00

Fix null key error

This commit is contained in:
Nayam Amarshe 2023-04-20 19:27:50 +05:30
parent 858d87da81
commit 7133df226f
2 changed files with 10 additions and 10 deletions

View File

@ -84,8 +84,8 @@ app.on("ready", async () => {
// SAVE LAST IMAGE PATH TO LOCAL STORAGE
mainWindow.webContents
.executeJavaScript('localStorage.getItem("lastImagePath");', true)
.then((lastImagePath) => {
if (lastImagePath.length > 0) {
.then((lastImagePath: string | null) => {
if (lastImagePath && lastImagePath.length > 0) {
imagePath = lastImagePath;
}
});
@ -93,8 +93,8 @@ app.on("ready", async () => {
// SAVE LAST FOLDER PATH TO LOCAL STORAGE
mainWindow.webContents
.executeJavaScript('localStorage.getItem("lastFolderPath");', true)
.then((lastFolderPath) => {
if (lastFolderPath.length > 0) {
.then((lastFolderPath: string | null) => {
if (lastFolderPath && lastFolderPath.length > 0) {
folderPath = lastFolderPath;
}
});
@ -105,8 +105,8 @@ app.on("ready", async () => {
'localStorage.getItem("lastCustomModelsFolderPath");',
true
)
.then((lastCustomModelsFolderPath) => {
if (lastCustomModelsFolderPath.length > 0) {
.then((lastCustomModelsFolderPath: string | null) => {
if (lastCustomModelsFolderPath && lastCustomModelsFolderPath.length > 0) {
customModelsFolderPath = lastCustomModelsFolderPath;
}
});
@ -114,8 +114,8 @@ app.on("ready", async () => {
// SAVE LAST CUSTOM MODELS FOLDER PATH TO LOCAL STORAGE
mainWindow.webContents
.executeJavaScript('localStorage.getItem("lastOutputFolderPath");', true)
.then((lastOutputFolderPath) => {
if (lastOutputFolderPath.length > 0) {
.then((lastOutputFolderPath: string | null) => {
if (lastOutputFolderPath && lastOutputFolderPath.length > 0) {
outputFolderPath = lastOutputFolderPath;
}
});

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "upscayl",
"version": "2.0.1",
"version": "2.5.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "upscayl",
"version": "2.0.1",
"version": "2.5.0",
"license": "AGPL-3.0",
"dependencies": {
"app-root-dir": "^1.0.2",