mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-27 23:36:13 +00:00
this is a fix for the "possibly null" error. dosent seem to cause runtime issues but does cause the compiler to throw an error (#1005)
## Description: this is a fix for the "possibly null" error. dosent seem to cause runtime issues but does cause the compiler to throw an error this just adds a safety check ## Please complete the following: - [x] I have added screenshots for all UI updates (No UI Updates) - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file (No Text Updates) - [x] I have added relevant tests to the test directory (No Tests to add) - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors ## Please put your Discord username so you can be contacted if a bug or regression is found: jerryslang
This commit is contained in:
@@ -240,7 +240,13 @@ export class TerritoryLayer implements Layer {
|
|||||||
|
|
||||||
while (numToRender > 0) {
|
while (numToRender > 0) {
|
||||||
numToRender--;
|
numToRender--;
|
||||||
const tile = this.tileToRenderQueue.pop().tile;
|
|
||||||
|
const entry = this.tileToRenderQueue.pop();
|
||||||
|
if (!entry) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
const tile = entry.tile;
|
||||||
this.paintTerritory(tile);
|
this.paintTerritory(tile);
|
||||||
for (const neighbor of this.game.neighbors(tile)) {
|
for (const neighbor of this.game.neighbors(tile)) {
|
||||||
this.paintTerritory(neighbor, true);
|
this.paintTerritory(neighbor, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user