Skip to content

Commit

Permalink
fix crash on scheme info (#2056)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkent600 committed Aug 12, 2020
1 parent e53dbf3 commit f3920e4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/pluginUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,16 @@ export function getPluginIsActive(plugin: IPluginState, action?: GetPluginIsActi
}
}

const votingMachineParams = (plugin as any).pluginParams[votingMachineParamsPropertyName];
const votingMachineParams = (plugin as any).pluginParams?.[votingMachineParamsPropertyName];

if (!votingMachineParams) {
// eslint-disable-next-line no-console
console.warn(` getPluginIsActive: voting machine parameters parameters not found for ${plugin.name}`);
console.warn(`getPluginIsActive: voting machine parameters parameters not found for ${plugin?.name ?? plugin.address}`);
return true;
}
if ((typeof(votingMachineParams.activationTime) === undefined) || (votingMachineParams.activationTime === null)) {
// eslint-disable-next-line no-console
console.warn(` getPluginIsActive: voting machine appears not to be GenesisProtocol: ${plugin.name}`);
console.warn(`getPluginIsActive: voting machine appears not to be GenesisProtocol: ${plugin.name}`);
return true;
} else {
return moment(votingMachineParams.activationTime*1000).isSameOrBefore(moment());
Expand Down

0 comments on commit f3920e4

Please sign in to comment.