From 176ecb16a87e452814e95d9f3fa39c5f1e28734c Mon Sep 17 00:00:00 2001 From: Deon George Date: Wed, 26 Jun 2024 11:22:33 +1000 Subject: [PATCH] Exit gracefully if we dont generate a packet for debug:packet:dump --- app/Console/Commands/Debug/PacketDump.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Console/Commands/Debug/PacketDump.php b/app/Console/Commands/Debug/PacketDump.php index a5e8610..8955722 100644 --- a/app/Console/Commands/Debug/PacketDump.php +++ b/app/Console/Commands/Debug/PacketDump.php @@ -49,6 +49,11 @@ class PacketDump extends Command 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')) { $this->info('Item Name:'.$pkt->name); $this->info('Item Type:'.get_class($pkt));