Skip to content

Commit

Permalink
Merge pull request #377 from Jameskmonger/fix-undefined-metadata
Browse files Browse the repository at this point in the history
fix: initialise `metadata` within Player
  • Loading branch information
SchauweM authored Sep 13, 2022
2 parents e8f41bc + 720dcd8 commit fb623b9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/engine/world/actor/player/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,9 @@ export class Player extends Actor {
* You cannot guarantee that this will be populated with data, so you should always check for the existence of the
* metadata you are looking for before using it.
*
* The ! is used to tell the compiler that we know this property will be defined.
*
* @author jameskmonger
*/
public readonly metadata!: (Actor['metadata'] & Partial<PlayerMetadata>);
public readonly metadata: (Actor['metadata'] & Partial<PlayerMetadata>) = {};

private readonly _socket: Socket;
private readonly _inCipher: Isaac;
Expand Down

0 comments on commit fb623b9

Please sign in to comment.