Index: branches/RL2/extensions/Gadgets/Gadgets.hooks.php |
— | — | @@ -78,8 +78,13 @@ |
79 | 79 | return true; |
80 | 80 | } |
81 | 81 | |
82 | | - $previousRev = $revision->getPrevious(); |
83 | | - $prevTs = $previousRev instanceof Revision ? $previousRev->getTimestamp() : wfTimestampNow(); |
| 82 | + $prevTs = wfTimestampNow(); |
| 83 | + if ( $revision ) { // $revision is null for null edits |
| 84 | + $previousRev = $revision->getPrevious(); |
| 85 | + if ( $previousRev ) { // $previousRev is null if there is no previous revision |
| 86 | + $prevTs = $previousRev->getTimestamp(); |
| 87 | + } |
| 88 | + } |
84 | 89 | |
85 | 90 | // Update the database entry for this gadget |
86 | 91 | $repo = LocalGadgetRepo::singleton(); |