Skip to content

Commit ff7b226

Browse files
committed
Add additional check to make sure we have OS detail when creating a new job #250
Signed-off-by: worksofliam <[email protected]>
1 parent d681fc3 commit ff7b226

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/connection/manager.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export class SQLJobManager {
2424

2525
async newJob(predefinedJob?: SQLJob, name?: string) {
2626
if (ServerComponent.isInstalled()) {
27-
const features = osDetail.getFeatures();
2827

2928
const instance = getInstance();
3029
const config = instance.getConfig();
@@ -42,9 +41,12 @@ export class SQLJobManager {
4241
try {
4342
await newJob.connect();
4443

45-
const selfDefault = SQLJobManager.getSelfDefault();
46-
if (features.SELF && selfDefault !== `*NONE`) {
47-
await newJob.setSelfState(selfDefault);
44+
if (osDetail) {
45+
const features = osDetail.getFeatures();
46+
const selfDefault = SQLJobManager.getSelfDefault();
47+
if (features.SELF && selfDefault !== `*NONE`) {
48+
await newJob.setSelfState(selfDefault);
49+
}
4850
}
4951

5052
this.totalJobs += 1;

0 commit comments

Comments
 (0)