Skip to content

Commit 69a1087

Browse files
クラッシュを修正 (#21)
* クラッシュを修正 * phpdocのミスを修正 * おそらくThreadCrashInfoFrameだけ * return type phpdoc を削除 Co-authored-by: ねらひかだ <hkshirorom@yahoo.co.jp> * 不足していたphpdocを追加 Co-authored-by: ねらひかだ <hkshirorom@yahoo.co.jp> --------- Co-authored-by: ねらひかだ <hkshirorom@yahoo.co.jp>
1 parent 39ed40e commit 69a1087

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/utils/CrashTracer.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace NeiroNetwork\EvalBook\utils;
66

77
use NeiroNetwork\EvalBook\Main;
8+
use pocketmine\thread\ThreadCrashInfoFrame;
89
use Symfony\Component\Filesystem\Path;
910

1011
final class CrashTracer{
@@ -34,11 +35,22 @@ public static function catchBadError(Main $plugin) : void{
3435
}
3536
}
3637

38+
/**
39+
* @param array{
40+
* type: string,
41+
* message: string,
42+
* fullFile: string,
43+
* file: string,
44+
* line: int,
45+
* trace: ThreadCrashInfoFrame[],
46+
* thread: string
47+
* } $error
48+
*/
3749
private static function causedByPlugin(array $error) : bool{
3850
if(self::isEvaldFile($error["fullFile"])) return true;
3951

4052
foreach($error["trace"] as $trace){
41-
if(self::isEvaldFile($trace["file"] ?? "")){
53+
if(self::isEvaldFile($trace->getFile() ?? "")){
4254
return true;
4355
}
4456
}

0 commit comments

Comments
 (0)