0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-12 16:10:43 -05:00

Fixed various invalid nullguard checks + comments

This commit is contained in:
Chomp 2024-12-22 21:48:06 +00:00
parent 863738087f
commit da8c336519

View File

@ -97,7 +97,7 @@ export class DatabaseService {
* @returns assets/database/locations * @returns assets/database/locations
*/ */
public getLocations(): ILocations { public getLocations(): ILocations {
if (!this.databaseServer.getTables().locales) { if (!this.databaseServer.getTables().locations) {
throw new Error( throw new Error(
this.localisationService.getText("database-data_at_path_missing", "assets/database/locales"), this.localisationService.getText("database-data_at_path_missing", "assets/database/locales"),
); );
@ -125,7 +125,7 @@ export class DatabaseService {
* @returns assets/database/match/ * @returns assets/database/match/
*/ */
public getMatch(): IMatch { public getMatch(): IMatch {
if (!this.databaseServer.getTables().locales) { if (!this.databaseServer.getTables().match) {
throw new Error( throw new Error(
this.localisationService.getText("database-data_at_path_missing", "assets/database/locales"), this.localisationService.getText("database-data_at_path_missing", "assets/database/locales"),
); );
@ -138,7 +138,7 @@ export class DatabaseService {
* @returns assets/database/server.json * @returns assets/database/server.json
*/ */
public getServer(): IServerBase { public getServer(): IServerBase {
if (!this.databaseServer.getTables().locales) { if (!this.databaseServer.getTables().server) {
throw new Error( throw new Error(
this.localisationService.getText("database-data_at_path_missing", "assets/database/server"), this.localisationService.getText("database-data_at_path_missing", "assets/database/server"),
); );
@ -151,7 +151,7 @@ export class DatabaseService {
* @returns assets/database/settings.json * @returns assets/database/settings.json
*/ */
public getSettings(): ISettingsBase { public getSettings(): ISettingsBase {
if (!this.databaseServer.getTables().locales) { if (!this.databaseServer.getTables().settings) {
throw new Error( throw new Error(
this.localisationService.getText("database-data_at_path_missing", "assets/database/settings"), this.localisationService.getText("database-data_at_path_missing", "assets/database/settings"),
); );
@ -206,7 +206,7 @@ export class DatabaseService {
} }
/** /**
* @returns assets/database/templates/items.json * @returns assets/database/templates/handbook.json
*/ */
public getHandbook(): IHandbookBase { public getHandbook(): IHandbookBase {
if (!this.databaseServer.getTables().templates.handbook) { if (!this.databaseServer.getTables().templates.handbook) {
@ -270,7 +270,7 @@ export class DatabaseService {
} }
/** /**
* @returns assets/database/templates/items.json * @returns assets/database/templates/quests.json
*/ */
public getQuests(): Record<string, IQuest> { public getQuests(): Record<string, IQuest> {
if (!this.databaseServer.getTables().templates.quests) { if (!this.databaseServer.getTables().templates.quests) {