Skip to content

Commit 2525ba6

Browse files
committed
refac(*): check for undefined (after api change)
1 parent 3adfe39 commit 2525ba6

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

server/src/aot/AureliaComponents.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ export class AureliaComponents {
244244
const viewDocument = TextDocumentUtils.createHtmlFromPath(
245245
component.viewFilePath
246246
);
247+
if (!viewDocument) return;
248+
247249
const regions = RegionParser.parse(viewDocument, componentList);
248250
component.viewRegions = regions;
249251
});

server/src/feature/definition/aureliaDefintion.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ async function getAureliaClassMemberDefinitions_SameView(
167167
viewExtensions
168168
);
169169
const viewDocument = TextDocumentUtils.createHtmlFromPath(viewPath);
170+
if (!viewDocument) return [];
171+
170172
const viewRegionDefinitions_ClassMembers: LocationLink[] = [];
171173
const regions = await findRegionsByWord(
172174
aureliaProgram,

server/src/feature/rename/aureliaRename.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ export async function aureliaRenameFromViewModel(
166166
);
167167

168168
const viewDocument = TextDocumentUtils.createHtmlFromPath(viewPath);
169+
if (!viewDocument) return;
170+
169171
const otherChangesInsideSameView = await renameAllOtherRegionsInSameView(
170172
aureliaProgram,
171173
viewDocument,

server/src/feature/symbols/onDocumentSymbol.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ export async function onDocumentSymbol(
1919
const document = TextDocumentUtils.createHtmlFromPath(
2020
UriUtils.toSysPath(documentUri)
2121
);
22+
if (!document) return [];
23+
2224
const viewModelPath = UriUtils.toSysPath(document.uri);
2325
const targetProject = container
2426
.get(AureliaProjects)

0 commit comments

Comments
 (0)