summaryrefslogtreecommitdiffstats
path: root/theme/list_lib.js
diff options
context:
space:
mode:
Diffstat (limited to 'theme/list_lib.js')
-rw-r--r--theme/list_lib.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/theme/list_lib.js b/theme/list_lib.js
index d3f9f8cac..775d83e4b 100644
--- a/theme/list_lib.js
+++ b/theme/list_lib.js
@@ -897,7 +897,7 @@ function get_bookmark_HTML(event)
*/
function get_bookmarks_HTML(dive)
{
- if (dive.events <= 0)
+ if (!dive.events || dive.events <= 0)
return "";
var result = "";
result += '<h2 class="det_hed">' + translate.Events + '</h2><table><tr><td class="words">' + translate.Name + '</td><td class="words">' + translate.Time + '</td><td class="words">' + translate.Value + '</td></tr>';
@@ -976,7 +976,7 @@ function get_status_HTML(dive)
function get_dive_photos(dive)
{
- if (dive.photos.length <= 0) {
+ if (!dive.photos || dive.photos.length <= 0) {
document.getElementById("divephotos").style.display = 'none';
return "";
}
@@ -1092,11 +1092,13 @@ function canvas_draw()
}
}
}
- for (var i = 0; i < items[dive_id].events.length; i++) {
- eventsData.push([
- items[dive_id].events[i].time / 60,
- 0
- ]);
+ if (items[dive_id].events) {
+ for (var i = 0; i < items[dive_id].events.length; i++) {
+ eventsData.push([
+ items[dive_id].events[i].time / 60,
+ 0
+ ]);
+ }
}
if (plot1) {
$('chart1').unbind();