Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/treetrek.git

Adds null guards to hashes

Author Dave Jarvis <email>
Date 2026-02-18 21:59:19 GMT-0800
Commit a922e2877bbff33f0cea18036a9294ff2cdb7c3b
Parent a2de074
Router.php
$this->filePath = implode( '/', $uriParts );
} elseif( $this->action === self::ACTION_COMMIT ) {
- $this->commitHash = array_shift( $uriParts );
+ $this->commitHash = array_shift( $uriParts ) ?? self::REFERENCE_HEAD;
} elseif( $this->action === self::ACTION_COMPARE ) {
- $this->commitHash = array_shift( $uriParts );
- $this->baseHash = array_shift( $uriParts );
+ $this->commitHash = array_shift( $uriParts ) ?? self::REFERENCE_HEAD;
+ $this->baseHash = array_shift( $uriParts ) ?? '';
}
Delta 3 lines added, 3 lines removed