File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,9 @@ public static function gather() {
55
55
if (!is_dir ($ annotationsDir )) {
56
56
Console::writeWarning ("<path> " .Console::getHumanReadablePath ($ annotationsDir )."</path><warning> doesn't exist so you won't have annotations... " );
57
57
mkdir ($ annotationsDir );
58
+ } else {
59
+
60
+
58
61
}
59
62
60
63
// find the markdown-based annotations
@@ -90,6 +93,7 @@ public static function gather() {
90
93
}
91
94
92
95
// read in the old style annotations.js, modify the data and generate JSON array to merge
96
+ $ data = array ();
93
97
$ oldStyleAnnotationsPath = $ annotationsDir .DIRECTORY_SEPARATOR ."annotations.js " ;
94
98
if (file_exists ($ oldStyleAnnotationsPath )) {
95
99
$ text = trim (file_get_contents ($ oldStyleAnnotationsPath ));
@@ -103,8 +107,10 @@ public static function gather() {
103
107
}
104
108
}
105
109
106
- // merge in any data from the old file
107
- self ::$ store ["comments " ] = array_merge (self ::$ store ["comments " ],$ data ["comments " ]);
110
+ // merge in any data from the old file if the json decode was successful
111
+ if (is_array ($ data ) && isset ($ data ["comments " ])) {
112
+ self ::$ store ["comments " ] = array_merge (self ::$ store ["comments " ],$ data ["comments " ]);
113
+ }
108
114
109
115
$ dispatcherInstance ->dispatch ("annotations.gatherEnd " );
110
116
You can’t perform that action at this time.
0 commit comments