Skip to content

Commit fa385ca

Browse files
committed
Bugs fixed and code review
1 parent bf96e0f commit fa385ca

17 files changed

+432
-237
lines changed

src/Configuration/IotConfigurationFolder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ export class IotConfigurationFolder {
2828
return this.ApplicationData+"\\tmp";}
2929
public get Schemas(): string {
3030
return this.Extension+"\\schemas";}
31-
public get WorkspaceFolder(): string| undefined {
32-
return IoTHelper.GetWorkspaceFolder();}
31+
public get WorkspaceDirectory(): string| undefined {
32+
return IoTHelper.GetWorkspaceDirectory();}
3333

3434
constructor(
3535
applicationDataPath: string,

src/Entity/EntityBaseAttribute.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ export class EntityBaseAttribute {
133133

134134
public ForceGetID(filePath:string):string|undefined
135135
{
136+
if(!fs.existsSync(filePath)) return undefined;
136137
try {
137138
const file = fs.readFileSync(filePath, 'utf8');
138139
const obj=YAML.parse(file);

src/Helper/IoTHelper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class IoTHelper {
2222
fs.mkdirSync(dir);
2323
}
2424

25-
static GetWorkspaceFolder(): string| undefined {
25+
static GetWorkspaceDirectory(): string| undefined {
2626
let folder = vscode.workspace.workspaceFolders;
2727
if (folder != undefined) return folder[0].uri.fsPath;
2828
return undefined;
@@ -214,7 +214,7 @@ export class IoTHelper {
214214
static SetTimeFiles(filesPath:string[],timestamp:number):IotResult
215215
{
216216
let result:IotResult;
217-
let lastFile:string="non";
217+
let lastFile:string|undefined;
218218
try {
219219
filesPath.forEach(path =>{
220220
lastFile=path;

0 commit comments

Comments
 (0)