     # Increases the selected file index by 1
     # undefined increments to 0
     increment_selected_file_index: =>
-        current_index = @get_store().selected_file_index ? -1
+        return if not store = @get_store()
+        current_index = store.selected_file_index ? -1
         @setState(selected_file_index : current_index + 1)
 
     # Decreases the selected file index by 1.
     # Guaranteed to never set below 0.
     # Does nothing when selected_file_index is undefined
     decrement_selected_file_index: =>
-        current_index = @get_store().selected_file_index
+        return if not store = @get_store()
+        current_index = store.selected_file_index
         if current_index? and current_index > 0
             @setState(selected_file_index : current_index - 1)
 

            path       : '/ext/library/cocalc-examples/index.json'

        fetch = (cb) =>
            $.ajax(
                url     : index_json_url
                timeout : 5000
                success : (data) =>
                    #if DEBUG then console.log("init_library/datadata
                    data = immutable.fromJS(data)
                    library = @get_store().library.set('examples', data)
                    @setState(library: library)
                    _init_library_index_cache[@project_id] = data
                    cb()

                path            : '.'
                cb              : (err, output) =>
                    if not err
                        if not store = @get_store()
                            cb('no store')
                            return
                        library = store.library
                        library = library.set(k, (output.exit_code == 0))
                        @setState(library: library)
                    cb(err)
