Exit gracefully if we dont generate a packet for debug:packet:dump

This commit is contained in:
Deon George 2024-06-26 11:22:33 +10:00
parent ad0ad73b0c
commit 176ecb16a8

View File

@ -49,6 +49,11 @@ class PacketDump extends Command
throw new \Exception('Unknown type: '.$this->argument('type')); throw new \Exception('Unknown type: '.$this->argument('type'));
} }
if (is_null($pkt)) {
$this->info(sprintf('No packet for [%s] of type [%s]',$this->argument('ftn'),$this->argument('type')));
return self::SUCCESS;
}
if (! $this->argument('file')) { if (! $this->argument('file')) {
$this->info('Item Name:'.$pkt->name); $this->info('Item Name:'.$pkt->name);
$this->info('Item Type:'.get_class($pkt)); $this->info('Item Type:'.get_class($pkt));