File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -408,11 +408,6 @@ function getFile ($id)
408408 $ result = $ db ->loadObject ();
409409 $ this ->track = $ result ; // Cache track for use with edit/delete etc
410410
411- if (! $ result )
412- {
413- return JTable::getInstance ('jtg_files ' , 'table ' );
414- }
415-
416411 return $ result ;
417412 }
418413
Original file line number Diff line number Diff line change @@ -200,6 +200,11 @@ public function display($tpl = null)
200200 $ document ->addScript (JUri::root (true ) . '/components/com_jtg/assets/js/animatedCursor.js ' );
201201 }
202202 $ this ->track = $ model ->getFile ( $ this ->id );
203+ if (!$ this ->track ) {
204+ $ mainframe ->enqueueMessage ("Track not found id " .$ this ->id ,'Error ' );
205+ $ mainframe ->redirect (Uri::root ());
206+ return false ;
207+ }
203208 $ file = JPATH_SITE . '/images/jtrackgallery/uploaded_tracks/ ' . strtolower ($ this ->track ->file );
204209 $ gpsData = new GpsDataClass ($ file , $ this ->track ->file );
205210 $ this ->imageList = $ model ->getImages ($ this ->id );
@@ -236,6 +241,7 @@ public function display($tpl = null)
236241 }
237242 else {
238243 $ gpsData = new GpsDataClass ;
244+ $ this ->tags = null ;
239245 }
240246 }
241247 if (! isset ($ this ->track ) )
You can’t perform that action at this time.
0 commit comments