@smartico/public-api 0.0.384 → 0.0.385

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -900,6 +900,9 @@ const InboxMessagesTransform = items => {
900
900
  };
901
901
 
902
902
  const InboxMessageBodyTransform = item => {
903
+ if (!item) {
904
+ return null;
905
+ }
903
906
  const x = {
904
907
  action: item.action,
905
908
  icon: item.image,
@@ -1882,7 +1885,7 @@ TournamentUtils.getPrizeTransformed = prize => {
1882
1885
  };
1883
1886
 
1884
1887
  const TournamentItemsTransform = items => {
1885
- return items.filter(r => r.tournamentId >= 1).map(r => {
1888
+ return items.filter(r => r != null && r.tournamentId >= 1).map(r => {
1886
1889
  const x = _extends({
1887
1890
  instance_id: r.tournamentInstanceId,
1888
1891
  tournament_id: r.tournamentId,
@@ -5643,6 +5646,9 @@ class WSAPIJackpots extends WSAPIClans {
5643
5646
  let pots = [];
5644
5647
  jackpots = await OCache.use(onUpdateContextKey.Jackpots, ECacheContext.WSAPI, async function () {
5645
5648
  const _jackpots = await _this.api.jackpotGet(_this.userExtId, filter);
5649
+ if (!(_jackpots != null && _jackpots.items)) {
5650
+ return [];
5651
+ }
5646
5652
  const _pots = _jackpots.items.map(jp => jp.pot);
5647
5653
  _jackpots.items.forEach(jp => {
5648
5654
  jp.jp_public_meta.custom_data = IntUtils.JsonOrText(jp.jp_public_meta.custom_data);
@@ -7151,6 +7157,9 @@ class WSAPIMiniGames extends WSAPIRaffles {
7151
7157
  async updateOnSpin(data) {
7152
7158
  const templates = await OCache.use(onUpdateContextKey.Saw, ECacheContext.WSAPI, () => this.api.sawGetTemplatesT(this.userExtId), CACHE_DATA_SEC);
7153
7159
  const index = templates.findIndex(t => t.id === data.saw_template_id);
7160
+ if (index === -1) {
7161
+ return;
7162
+ }
7154
7163
  templates[index].spin_count = data.spin_count;
7155
7164
  this.updateEntity(onUpdateContextKey.Saw, templates);
7156
7165
  }